Modules/USB MSC - Error handling and fix for Tegra2 Qemu
[tpg/acess2.git] / KernelLand / Modules / USB / MSC / scsi.h
1 /*
2  * Acess2 USB Stack Mass Storage Driver
3  * - By John Hodge (thePowersGang)
4  *
5  * scsi.h
6  * - "SCSI Transparent Command Set" handling code
7  */
8 #ifndef _MSC__SCSI_H_
9 #define _MSC__SCSI_H_
10
11 // NOTE: All commands are big-endian
12 enum eSCSI_Ops
13 {
14         READ_CAPACITY_10 = 0x25,
15         SERVICE_ACTION_IN_16 = 0x9E
16 };
17
18 struct sSCSI_Cmd_RequestSense
19 {
20         Uint8   Op;     // 0x03
21         Uint8   Desc;
22         Uint16  _resvd;
23         Uint8   AllocationLength;
24         Uint8   Control;
25 } PACKED;
26
27 struct sSCSI_SenseData
28 {
29         Uint8   ResponseCode;
30         Uint8   _obselete;
31         Uint8   Flags;
32         Uint32  Information;
33         Uint8   AdditionalSenseLength;
34         Uint32  CommandSpecInfomation;
35         Uint8   AdditionalSenseCode;
36         Uint8   AdditionalSenseCodeQual;
37         Uint8   FRUC;
38         //Uint
39 } PACKED;
40
41 struct sSCSI_Cmd_ReadCapacity10
42 {
43         Uint8   Op;     // 0x25
44         Uint8   _resvd1;
45         Uint32  LBA;
46         Uint16  _resvd2;
47         Uint8   Flags;
48         Uint8   Control;
49 } PACKED;
50
51 struct sSCSI_Cmd_ReadCapacity16
52 {
53         Uint8   Op;     // 0x9E
54         Uint8   Svc;    // 0x10
55         Uint64  LBA;    //
56         Uint32  AllocationLength;
57         Uint8   Flags;
58         Uint8   Control;
59 } PACKED;
60
61 struct sSCSI_Ret_ReadCapacity10
62 {
63         Uint32  LastBlock;
64         Uint32  BlockSize;
65 } PACKED;
66
67 struct sSCSI_Ret_ReadCapacity16
68 {
69         Uint64  LastBlock;
70         Uint32  BlockSize;
71         Uint8   Flags;
72         Uint8   _resvd[32-13];
73 } PACKED;
74
75 struct sSCSI_Cmd_Read6
76 {
77         Uint8   Op;     // 0x08
78         Uint8   LBATop;
79         Uint16  LBALower;
80         Uint8   Length;
81         Uint8   Control;
82 } PACKED;
83
84 struct sSCSI_Cmd_Read10
85 {
86         Uint8   Op;     // 0x28
87         Uint8   Flags;
88         Uint32  LBA;
89         Uint8   GroupNumber;
90         Uint16  Length;
91         Uint8   Control;
92 } PACKED;
93
94 struct sSCSI_Cmd_Read16
95 {
96         Uint8   Op;     // 0x88
97         Uint8   Flags;
98         Uint64  LBA;
99         Uint32  Length;
100         Uint8   GroupNumber;
101         Uint8   Control;
102 } PACKED;
103
104 #endif
105

UCC git Repository :: git.ucc.asn.au