1 |
/*---------------------------------------------------------------------------- |
---|
2 |
* U S B - K e r n e l |
---|
3 |
*---------------------------------------------------------------------------- |
---|
4 |
* Name: MSC.H |
---|
5 |
* Purpose: USB Mass Storage Class Definitions |
---|
6 |
* Version: V1.10 |
---|
7 |
*---------------------------------------------------------------------------- |
---|
8 |
* This file is part of the uVision/ARM development tools. |
---|
9 |
* This software may only be used under the terms of a valid, current, |
---|
10 |
* end user licence from KEIL for a compatible version of KEIL software |
---|
11 |
* development tools. Nothing else gives you the right to use it. |
---|
12 |
* |
---|
13 |
* Copyright (c) 2005-2007 Keil Software. |
---|
14 |
*---------------------------------------------------------------------------*/ |
---|
15 |
|
---|
16 |
#ifndef __MSC_H__ |
---|
17 |
#define __MSC_H__ |
---|
18 |
|
---|
19 |
|
---|
20 |
/* MSC Subclass Codes */ |
---|
21 |
#define MSC_SUBCLASS_RBC 0x01 |
---|
22 |
#define MSC_SUBCLASS_SFF8020I_MMC2 0x02 |
---|
23 |
#define MSC_SUBCLASS_QIC157 0x03 |
---|
24 |
#define MSC_SUBCLASS_UFI 0x04 |
---|
25 |
#define MSC_SUBCLASS_SFF8070I 0x05 |
---|
26 |
#define MSC_SUBCLASS_SCSI 0x06 |
---|
27 |
|
---|
28 |
/* MSC Protocol Codes */ |
---|
29 |
#define MSC_PROTOCOL_CBI_INT 0x00 |
---|
30 |
#define MSC_PROTOCOL_CBI_NOINT 0x01 |
---|
31 |
#define MSC_PROTOCOL_BULK_ONLY 0x50 |
---|
32 |
|
---|
33 |
|
---|
34 |
/* MSC Request Codes */ |
---|
35 |
#define MSC_REQUEST_RESET 0xFF |
---|
36 |
#define MSC_REQUEST_GET_MAX_LUN 0xFE |
---|
37 |
|
---|
38 |
|
---|
39 |
/* MSC Bulk-only Stage */ |
---|
40 |
#define MSC_BS_CBW 0 /* Command Block Wrapper */ |
---|
41 |
#define MSC_BS_DATA_OUT 1 /* Data Out Phase */ |
---|
42 |
#define MSC_BS_DATA_IN 2 /* Data In Phase */ |
---|
43 |
#define MSC_BS_DATA_IN_LAST 3 /* Data In Last Phase */ |
---|
44 |
#define MSC_BS_DATA_IN_LAST_STALL 4 /* Data In Last Phase with Stall */ |
---|
45 |
#define MSC_BS_CSW 5 /* Command Status Wrapper */ |
---|
46 |
#define MSC_BS_ERROR 6 /* Error */ |
---|
47 |
|
---|
48 |
|
---|
49 |
/* Bulk-only Command Block Wrapper */ |
---|
50 |
typedef __packed struct _MSC_CBW { |
---|
51 |
DWORD dSignature; |
---|
52 |
DWORD dTag; |
---|
53 |
DWORD dDataLength; |
---|
54 |
BYTE bmFlags; |
---|
55 |
BYTE bLUN; |
---|
56 |
BYTE bCBLength; |
---|
57 |
BYTE CB[16]; |
---|
58 |
} MSC_CBW; |
---|
59 |
|
---|
60 |
/* Bulk-only Command Status Wrapper */ |
---|
61 |
typedef __packed struct _MSC_CSW { |
---|
62 |
DWORD dSignature; |
---|
63 |
DWORD dTag; |
---|
64 |
DWORD dDataResidue; |
---|
65 |
BYTE bStatus; |
---|
66 |
} MSC_CSW; |
---|
67 |
|
---|
68 |
#define MSC_CBW_Signature 0x43425355 |
---|
69 |
#define MSC_CSW_Signature 0x53425355 |
---|
70 |
|
---|
71 |
|
---|
72 |
/* CSW Status Definitions */ |
---|
73 |
#define CSW_CMD_PASSED 0x00 |
---|
74 |
#define CSW_CMD_FAILED 0x01 |
---|
75 |
#define CSW_PHASE_ERROR 0x02 |
---|
76 |
|
---|
77 |
|
---|
78 |
/* SCSI Commands */ |
---|
79 |
#define SCSI_TEST_UNIT_READY 0x00 |
---|
80 |
#define SCSI_REQUEST_SENSE 0x03 |
---|
81 |
#define SCSI_FORMAT_UNIT 0x04 |
---|
82 |
#define SCSI_INQUIRY 0x12 |
---|
83 |
#define SCSI_MODE_SELECT6 0x15 |
---|
84 |
#define SCSI_MODE_SENSE6 0x1A |
---|
85 |
#define SCSI_START_STOP_UNIT 0x1B |
---|
86 |
#define SCSI_MEDIA_REMOVAL 0x1E |
---|
87 |
#define SCSI_READ_FORMAT_CAPACITIES 0x23 |
---|
88 |
#define SCSI_READ_CAPACITY 0x25 |
---|
89 |
#define SCSI_READ10 0x28 |
---|
90 |
#define SCSI_WRITE10 0x2A |
---|
91 |
#define SCSI_VERIFY10 0x2F |
---|
92 |
#define SCSI_MODE_SELECT10 0x55 |
---|
93 |
#define SCSI_MODE_SENSE10 0x5A |
---|
94 |
|
---|
95 |
|
---|
96 |
#endif /* __MSC_H__ */ |
---|