📄 msscsi.h
字号:
#ifndef _MS_SCSI_H_
#define _MS_SCSI_H_
/*
* Common Command set
*/
#define SCSI_CMD_CHNGDEF 0x40 /* Modifies the operating
definition */
#define SCSI_CMD_COMPARE 0x39 /* Compares data between LUN's */
#define SCSI_CMD_COPY 0x18 /* Copies data between LUN's */
#define SCSI_CMD_CPVRFY 0x3A /* same as above with
verification */
#define SCSI_CMD_INQUIRY 0x12 /* Request information from
device */
#define SCSI_CMD_LOGSLCT 0x4C /* Manage statistical
information */
#define SCSI_CMD_LOGSNS 0x4D /* Retrieve statistical
information */
#define SCSI_CMD_MDSLCT6 0x15 /* specify parameters to
target */
#define SCSI_CMD_MDSLCT10 0x55 /* -do- */
#define SCSI_CMD_MDSNS6 0x1A /* report parameters to
initiator */
#define SCSI_CMD_MDSNS10 0x5A /* -do- */
#define SCSI_CMD_READB 0x3C /* read target memory*/
#define SCSI_CMD_RCVDGN 0x1C /* requests analysis data
*/
#define SCSI_CMD_REQSNS 0x03 /* requests sense data*/
#define SCSI_CMD_SNDDGN 0x1D /* requests diagnostic
results */
#define SCSI_CMD_TSTUNTRDY 0x00 /* check if logical unit is
ready */
#define SCSI_CMD_WRITEB 0x3B /* write to target memory
*/
#define SCSI_CMD_READ_FMT_CPC 0x23 /* Raed format cpacity */
#define SCSI_CMD_READ_CPC 0x25
#define SCSI_CMD_REMOVAL 0x1E
/*
* Direct access devices commands
*/
#define SCSI_CMD_FORMATU 0x04 /* formats the medium */
#define SCSI_CMD_READ6 0x08 /* Read data */
#define SCSI_CMD_READ10 0x28 /* -do- */
#define SCSI_CMD_WRITE6 0x0A /* write data */
#define SCSI_CMD_WRITE10 0x2A /* -do- */
#define SCSI_CMD_SEEK6 0x0B /* Seek to a track */
#define SCSI_CMD_SEEK10 0x2B /* Seek to a track */
/*
* Different SCSI command lengths
*/
#define SCSI_CMD_LENGTH06 0x06
#define SCSI_CMD_LENGTH10 0x0A
#define SCSI_CMD_LENGTH12 0x0C
#define SCSI_CMD_LENGTH16 0x10
#define SCSI_MAX_CMD_LENGTH 0x10
/*
* Differnt data sizes of data stage of of SCSI command
*/
#define SCSI_CMD_INQ_DATA_LEN 0x24
#define SCSI_CMD_RDFMTCPC_DATA_LEN 0x0C
#define SCSI_CMD_REQ_SENSE_LEN 0x12
#define SCSI_CMD_RDCPC_DATA_LEN 0x08
#define USB_DATA_DIR_IN 1
#define USB_DATA_DIR_OUT 0
typedef struct
{
__u8 lun;
__u16 count;
__u32 sector;
void *buf_P;
__s32 reading;
__u8 cmd;
__u8 unused1;
__u16 unused2;
}SCSI_CLT_T;
__s8 TestRdy_Command(__u8 lun);
__s8 Inquiry_Command(__u8 lun, __u8 *RMB, __u8 *DeviceType);
__s8 ReqSen_Command(__u8 lun);
__s8 Rd10_Command(__u8 lun,__u16 count,__u32 sector);
__s8 Wt10_Command(__u8 lun,__u16 count,__u32 sector);
__s8 RdFmtCap_Command(__u8 lun,__u32 *noblock,__u32 *blocksize);
__s8 RdCap_Command(__u8 lun,__u32 *noblock,__u32 *blocksize);
__s8 Removal_Command(__u8 lun);
void Init_MassStorage(void);
void Det_MassStorage(void);
#endif /* _MS_SCSI_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -