GD32F10x USB-Device: E:/USB Libraries/GD32_USB_Device_Library/Class/msc/inc/usbd_msc_scsi.h Source File

GD32F103 Firmware

usbd_msc_scsi.h
Go to the documentation of this file.
1 
11 /* Define to prevent recursive inclusion -------------------------------------*/
12 #ifndef __GD32F10X_USBD_MSC_SCSI_H
13 #define __GD32F10X_USBD_MSC_SCSI_H
14 
15 /* Includes ------------------------------------------------------------------*/
16 #include "usbd_msc_data.h"
17 #include "usbd_msc_bot.h"
18 
38 #define SENSE_LIST_DEEPTH 4
39 
40 /* SCSI Commands */
41 #define SCSI_FORMAT_UNIT 0x04
42 #define SCSI_INQUIRY 0x12
43 #define SCSI_MODE_SELECT6 0x15
44 #define SCSI_MODE_SELECT10 0x55
45 #define SCSI_MODE_SENSE6 0x1A
46 #define SCSI_MODE_SENSE10 0x5A
47 #define SCSI_ALLOW_MEDIUM_REMOVAL 0x1E
48 #define SCSI_READ6 0x08
49 #define SCSI_READ10 0x28
50 #define SCSI_READ12 0xA8
51 #define SCSI_READ16 0x88
52 
53 #define SCSI_READ_CAPACITY10 0x25
54 #define SCSI_READ_CAPACITY16 0x9E
55 
56 #define SCSI_REQUEST_SENSE 0x03
57 #define SCSI_START_STOP_UNIT 0x1B
58 #define SCSI_TEST_UNIT_READY 0x00
59 #define SCSI_WRITE6 0x0A
60 #define SCSI_WRITE10 0x2A
61 #define SCSI_WRITE12 0xAA
62 #define SCSI_WRITE16 0x8A
63 
64 #define SCSI_VERIFY10 0x2F
65 #define SCSI_VERIFY12 0xAF
66 #define SCSI_VERIFY16 0x8F
67 
68 #define SCSI_SEND_DIAGNOSTIC 0x1D
69 #define SCSI_READ_FORMAT_CAPACITIES 0x23
70 
71 #define NO_SENSE 0
72 #define RECOVERED_ERROR 1
73 #define NOT_READY 2
74 #define MEDIUM_ERROR 3
75 #define HARDWARE_ERROR 4
76 #define ILLEGAL_REQUEST 5
77 #define UNIT_ATTENTION 6
78 #define DATA_PROTECT 7
79 #define BLANK_CHECK 8
80 #define VENDOR_SPECIFIC 9
81 #define COPY_ABORTED 10
82 #define ABORTED_COMMAND 11
83 #define VOLUME_OVERFLOW 13
84 #define MISCOMPARE 14
85 
86 
87 #define INVALID_CDB 0x20
88 #define INVALID_FIELED_IN_COMMAND 0x24
89 #define PARAMETER_LIST_LENGTH_ERROR 0x1A
90 #define INVALID_FIELD_IN_PARAMETER_LIST 0x26
91 #define ADDRESS_OUT_OF_RANGE 0x21
92 #define MEDIUM_NOT_PRESENT 0x3A
93 #define MEDIUM_HAVE_CHANGED 0x28
94 #define WRITE_PROTECTED 0x27
95 #define UNRECOVERED_READ_ERROR 0x11
96 #define WRITE_FAULT 0x03
97 
98 #define READ_FORMAT_CAPACITY_DATA_LEN 0x0C
99 #define READ_CAPACITY10_DATA_LEN 0x08
100 #define MODE_SENSE10_DATA_LEN 0x08
101 #define MODE_SENSE6_DATA_LEN 0x04
102 #define REQUEST_SENSE_DATA_LEN 0x12
103 #define STANDARD_INQUIRY_DATA_LEN 0x24
104 #define BLKVFY 0x04
105 
113 typedef struct _SENSE_ITEM
114 {
115  uint8_t SenseKey;
116  uint32_t Information;
117  uint8_t ASC;
118  uint8_t ASCQ;
120 
128 extern uint8_t Page00_Inquiry_Data[];
129 extern uint8_t Standard_Inquiry_Data[];
130 extern uint8_t Standard_Inquiry_Data2[];
131 extern uint8_t Mode_Sense6_data[];
132 extern uint8_t Mode_Sense10_data[];
133 extern uint8_t Scsi_Sense_Data[];
134 extern uint8_t ReadCapacity10_Data[];
135 extern uint8_t ReadFormatCapacity_Data[];
136 
137 extern SCSI_Sense_TypeDef SCSI_Sense[SENSE_LIST_DEEPTH];
138 extern uint8_t SCSI_Sense_Head;
139 extern uint8_t SCSI_Sense_Tail;
140 
148 int8_t SCSI_ProcessCmd (USB_DEVICE_HANDLE *pudev,
149  uint8_t Lun,
150  uint8_t *cmd);
151 
152 void SCSI_SenseCode (uint8_t Lun,
153  uint8_t SKey,
154  uint8_t ASC);
155 
156 int8_t SCSI_ProcessRead (uint8_t Lun);
157 int8_t SCSI_ProcessWrite (uint8_t Lun);
158 
163 #endif /* __GD32F10X_USBD_MSC_SCSI_H */
164 
181 /************************ (C) COPYRIGHT 2014 GIGADEVICE *****END OF FILE****/
182 
void SCSI_SenseCode(uint8_t Lun, uint8_t SKey, uint8_t ASC)
Load the last error code in the error list.
Header file for the usbd_msc_data.c file.
int8_t SCSI_ProcessCmd(USB_DEVICE_HANDLE *pudev, uint8_t Lun, uint8_t *cmd)
Process SCSI commands.
Definition: usbd_msc_scsi.c:87
int8_t SCSI_ProcessRead(uint8_t Lun)
Handle Read Process.
int8_t SCSI_ProcessWrite(uint8_t Lun)
Handle write process.
Header file for the usbd_msc_bot.c file.
Generated on Fri Feb 6 2015 14:56:35 for GD32F10x USB-Device by   doxygen 1.8.8