usbd_msc_scsi.h
Go to the documentation of this file.
1 
28 /* Define to prevent recursive inclusion -------------------------------------*/
29 #ifndef __USBD_MSC_SCSI_H
30 #define __USBD_MSC_SCSI_H
31 
32 /* Includes ------------------------------------------------------------------*/
33 #include "usbd_def.h"
34 
48 #define SENSE_LIST_DEEPTH 4
49 
50 /* SCSI Commands */
51 #define SCSI_FORMAT_UNIT 0x04
52 #define SCSI_INQUIRY 0x12
53 #define SCSI_MODE_SELECT6 0x15
54 #define SCSI_MODE_SELECT10 0x55
55 #define SCSI_MODE_SENSE6 0x1A
56 #define SCSI_MODE_SENSE10 0x5A
57 #define SCSI_ALLOW_MEDIUM_REMOVAL 0x1E
58 #define SCSI_READ6 0x08
59 #define SCSI_READ10 0x28
60 #define SCSI_READ12 0xA8
61 #define SCSI_READ16 0x88
62 
63 #define SCSI_READ_CAPACITY10 0x25
64 #define SCSI_READ_CAPACITY16 0x9E
65 
66 #define SCSI_REQUEST_SENSE 0x03
67 #define SCSI_START_STOP_UNIT 0x1B
68 #define SCSI_TEST_UNIT_READY 0x00
69 #define SCSI_WRITE6 0x0A
70 #define SCSI_WRITE10 0x2A
71 #define SCSI_WRITE12 0xAA
72 #define SCSI_WRITE16 0x8A
73 
74 #define SCSI_VERIFY10 0x2F
75 #define SCSI_VERIFY12 0xAF
76 #define SCSI_VERIFY16 0x8F
77 
78 #define SCSI_SEND_DIAGNOSTIC 0x1D
79 #define SCSI_READ_FORMAT_CAPACITIES 0x23
80 
81 #define NO_SENSE 0
82 #define RECOVERED_ERROR 1
83 #define NOT_READY 2
84 #define MEDIUM_ERROR 3
85 #define HARDWARE_ERROR 4
86 #define ILLEGAL_REQUEST 5
87 #define UNIT_ATTENTION 6
88 #define DATA_PROTECT 7
89 #define BLANK_CHECK 8
90 #define VENDOR_SPECIFIC 9
91 #define COPY_ABORTED 10
92 #define ABORTED_COMMAND 11
93 #define VOLUME_OVERFLOW 13
94 #define MISCOMPARE 14
95 
96 
97 #define INVALID_CDB 0x20
98 #define INVALID_FIELED_IN_COMMAND 0x24
99 #define PARAMETER_LIST_LENGTH_ERROR 0x1A
100 #define INVALID_FIELD_IN_PARAMETER_LIST 0x26
101 #define ADDRESS_OUT_OF_RANGE 0x21
102 #define MEDIUM_NOT_PRESENT 0x3A
103 #define MEDIUM_HAVE_CHANGED 0x28
104 #define WRITE_PROTECTED 0x27
105 #define UNRECOVERED_READ_ERROR 0x11
106 #define WRITE_FAULT 0x03
107 
108 #define READ_FORMAT_CAPACITY_DATA_LEN 0x0C
109 #define READ_CAPACITY10_DATA_LEN 0x08
110 #define MODE_SENSE10_DATA_LEN 0x08
111 #define MODE_SENSE6_DATA_LEN 0x04
112 #define REQUEST_SENSE_DATA_LEN 0x12
113 #define STANDARD_INQUIRY_DATA_LEN 0x24
114 #define BLKVFY 0x04
115 
116 extern uint8_t Page00_Inquiry_Data[];
117 extern uint8_t Standard_Inquiry_Data[];
118 extern uint8_t Standard_Inquiry_Data2[];
119 extern uint8_t Mode_Sense6_data[];
120 extern uint8_t Mode_Sense10_data[];
121 extern uint8_t Scsi_Sense_Data[];
122 extern uint8_t ReadCapacity10_Data[];
123 extern uint8_t ReadFormatCapacity_Data [];
133 typedef struct _SENSE_ITEM {
134  char Skey;
135  union {
136  struct _ASCs {
137  char ASC;
138  char ASCQ;
139  }b;
140  unsigned int ASC;
141  char *pData;
142  } w;
160 extern uint8_t SCSI_Sense_Head;
161 extern uint8_t SCSI_Sense_Tail;
162 
170  uint8_t lun,
171  uint8_t *cmd);
172 
173 void SCSI_SenseCode(uint8_t lun,
174  uint8_t sKey,
175  uint8_t ASC);
176 
181 #endif /* __USBD_MSC_SCSI_H */
182 
194 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
195 
uint8_t Mode_Sense10_data[]
uint8_t SCSI_Sense_Tail
Definition: usbd_msc_scsi.c:79
struct _SENSE_ITEM::@58::_ASCs b
static uint8_t cmd
Definition: drv_hmc5883l.c:79
int8_t SCSI_ProcessCmd(USB_OTG_CORE_HANDLE *pdev, uint8_t lun, uint8_t *cmd)
SCSI_ProcessCmd Process SCSI commands.
SCSI_Sense_TypeDef SCSI_Sense[SENSE_LIST_DEEPTH]
Definition: usbd_msc_scsi.c:77
struct _SENSE_ITEM SCSI_Sense_TypeDef
uint8_t ReadFormatCapacity_Data[]
uint8_t Standard_Inquiry_Data[]
uint8_t ReadCapacity10_Data[]
uint8_t Scsi_Sense_Data[]
uint8_t Standard_Inquiry_Data2[]
#define SENSE_LIST_DEEPTH
Definition: usbd_msc_scsi.h:48
unsigned int ASC
void SCSI_SenseCode(uint8_t lun, uint8_t sKey, uint8_t ASC)
SCSI_SenseCode Load the last error code in the error list.
uint8_t Mode_Sense6_data[]
union _SENSE_ITEM::@58 w
uint8_t SCSI_Sense_Head
Definition: usbd_msc_scsi.c:78
general defines for the usb device library
uint8_t Page00_Inquiry_Data[]


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Wed Jul 3 2019 19:59:26