1 /***********************************************************************
\r
2 * $Id:: mw_usbd_msc.h 331 2012-08-09 18:54:34Z usb10131 $
\r
4 * Project: USB device ROM Stack
\r
7 * Mass Storage Class definitions.
\r
9 ***********************************************************************
\r
10 * Copyright(C) 2011, NXP Semiconductor
\r
11 * All rights reserved.
\r
13 * Software that is described herein is for illustrative purposes only
\r
14 * which provides customers with programming information regarding the
\r
15 * products. This software is supplied "AS IS" without any warranties.
\r
16 * NXP Semiconductors assumes no responsibility or liability for the
\r
17 * use of the software, conveys no license or title under any patent,
\r
18 * copyright, or mask work right to the product. NXP Semiconductors
\r
19 * reserves the right to make changes in the software without
\r
20 * notification. NXP Semiconductors also make no representation or
\r
21 * warranty that such application will be suitable for the specified
\r
22 * use without further testing or modification.
\r
23 **********************************************************************/
\r
31 * \brief Mass Storage class (MSC) descriptors.
\r
33 * Definition of MSC class descriptors and their bit defines.
\r
37 /* MSC Subclass Codes */
\r
38 #define MSC_SUBCLASS_RBC 0x01
\r
39 #define MSC_SUBCLASS_SFF8020I_MMC2 0x02
\r
40 #define MSC_SUBCLASS_QIC157 0x03
\r
41 #define MSC_SUBCLASS_UFI 0x04
\r
42 #define MSC_SUBCLASS_SFF8070I 0x05
\r
43 #define MSC_SUBCLASS_SCSI 0x06
\r
45 /* MSC Protocol Codes */
\r
46 #define MSC_PROTOCOL_CBI_INT 0x00
\r
47 #define MSC_PROTOCOL_CBI_NOINT 0x01
\r
48 #define MSC_PROTOCOL_BULK_ONLY 0x50
\r
51 /* MSC Request Codes */
\r
52 #define MSC_REQUEST_RESET 0xFF
\r
53 #define MSC_REQUEST_GET_MAX_LUN 0xFE
\r
56 /* MSC Bulk-only Stage */
\r
57 #define MSC_BS_CBW 0 /* Command Block Wrapper */
\r
58 #define MSC_BS_DATA_OUT 1 /* Data Out Phase */
\r
59 #define MSC_BS_DATA_IN 2 /* Data In Phase */
\r
60 #define MSC_BS_DATA_IN_LAST 3 /* Data In Last Phase */
\r
61 #define MSC_BS_DATA_IN_LAST_STALL 4 /* Data In Last Phase with Stall */
\r
62 #define MSC_BS_CSW 5 /* Command Status Wrapper */
\r
63 #define MSC_BS_ERROR 6 /* Error */
\r
66 /* Bulk-only Command Block Wrapper */
\r
67 PRE_PACK struct POST_PACK _MSC_CBW
\r
69 uint32_t dSignature;
\r
71 uint32_t dDataLength;
\r
77 typedef struct _MSC_CBW MSC_CBW;
\r
79 /* Bulk-only Command Status Wrapper */
\r
80 PRE_PACK struct POST_PACK _MSC_CSW
\r
82 uint32_t dSignature;
\r
84 uint32_t dDataResidue;
\r
87 typedef struct _MSC_CSW MSC_CSW;
\r
89 #define MSC_CBW_Signature 0x43425355
\r
90 #define MSC_CSW_Signature 0x53425355
\r
93 /* CSW Status Definitions */
\r
94 #define CSW_CMD_PASSED 0x00
\r
95 #define CSW_CMD_FAILED 0x01
\r
96 #define CSW_PHASE_ERROR 0x02
\r
100 #define SCSI_TEST_UNIT_READY 0x00
\r
101 #define SCSI_REQUEST_SENSE 0x03
\r
102 #define SCSI_FORMAT_UNIT 0x04
\r
103 #define SCSI_INQUIRY 0x12
\r
104 #define SCSI_MODE_SELECT6 0x15
\r
105 #define SCSI_MODE_SENSE6 0x1A
\r
106 #define SCSI_START_STOP_UNIT 0x1B
\r
107 #define SCSI_MEDIA_REMOVAL 0x1E
\r
108 #define SCSI_READ_FORMAT_CAPACITIES 0x23
\r
109 #define SCSI_READ_CAPACITY 0x25
\r
110 #define SCSI_READ10 0x28
\r
111 #define SCSI_WRITE10 0x2A
\r
112 #define SCSI_VERIFY10 0x2F
\r
113 #define SCSI_READ12 0xA8
\r
114 #define SCSI_WRITE12 0xAA
\r
115 #define SCSI_MODE_SELECT10 0x55
\r
116 #define SCSI_MODE_SENSE10 0x5A
\r
119 #endif /* __MSC_H__ */
\r