Modules/AHCI - Added H2D register structure (used for commands)
[tpg/acess2.git] / KernelLand / Modules / Storage / AHCI / sata.h
1 /*
2  * Acess2 Kernel - AHCI Driver
3  * - By John Hodge (thePowersGang)
4  *
5  * sata.h
6  * - SATA Structures
7  */
8 #ifndef _AHCI__SATA_H_
9 #define _AHCI__SATA_H_
10
11 enum eSATA_FIS_Types
12 {
13         SATA_FIS_D2HRegister = 0x34,
14         SATA_FIS_DMASetup = 0x41,
15         SATA_FIS_Data = 0x46,
16         SATA_FIS_PIOSetup = 0x5F,
17 };
18
19 struct sSATA_FIS_DMASetup
20 {
21         Uint8   Type;   // = 0x41
22         Uint8   Flags;  // [6]: Interrupt, [5]: Direction
23         Uint8   _resvd1[2];
24         Uint32  DMABufIdLow;
25         Uint32  DMABufIdHigh;
26         Uint32  _resvd2[1];
27         Uint32  DMABufOfs;
28         Uint32  DMATransferCount;
29         Uint32  _resvd[1];
30 } PACKED;
31 struct sSATA_FIS_Data
32 {
33         Uint8   Type;   // = 0x46
34         Uint8   _resvd[3];
35         Uint32  Data[1];
36 } PACKED;
37 struct sSATA_FIS_PIOSetup
38 {
39         Uint8   Type;   // = 0x5F
40         Uint8   Flags;
41         Uint8   Status;
42         Uint8   Error;
43         Uint8   SectorNum;
44         Uint8   CylLow;
45         Uint8   CylHigh;
46         Uint8   Dev_Head;
47         Uint8   SectorNumExp;
48         Uint8   CylLowExp;
49         Uint8   CylHighExp;
50         Uint8   _resvd1[1];
51         Uint8   SectorCount;
52         Uint8   SectorCountExp;
53         Uint8   _resvd2[1];
54         Uint8   E_Status;
55         Uint16  TransferCount;
56         Uint8   _resvd3[2];
57 } PACKED;
58 struct sSATA_FIS_H2DRegister
59 {
60         Uint8   Type;   // = 0x27
61         Uint8   Flags;  // [7]: Update to command register
62         Uint8   Command;
63         Uint8   Features;
64         Uint8   SectorNum;
65         Uint8   CylLow;
66         Uint8   CylHigh;
67         Uint8   Dev_Head;
68         Uint8   SectorNumExp;
69         Uint8   CylLowExp;
70         Uint8   CylHighExp;
71         Uint8   FeaturesExp;
72         Uint8   SectorCount;
73         Uint8   SectorCountExp;
74         Uint8   _resvd1;
75         Uint8   Control;
76         Uint8   _resvd2[4];
77 } PACKED;
78 struct sSATA_FIS_D2HRegister
79 {
80         Uint8   Type;   // = 0x34
81         Uint8   IntResvd;       // [6]: Interrupt bit
82         Uint8   Status;
83         Uint8   Error;
84         Uint8   SectorNum;
85         Uint8   CylLow;
86         Uint8   CylHigh;
87         Uint8   Dev_Head;
88         Uint8   SectorNumExp;
89         Uint8   CylLowExp;
90         Uint8   CylHighExp;
91         Uint8   _resvd1[1];
92         Uint8   SectorCount;
93         Uint8   SectorCountExp;
94         Uint8   _resvd[6];
95 } PACKED;
96 struct sSATA_FIS_SDB
97 {
98         Uint8   Type;   // = 0xA1
99         Uint8   IntResvd;
100         Uint8   Status;
101         Uint8   Error;
102         Uint32  _resvd[1];
103 } PACKED;
104
105 #endif
106

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