7730c7532e50e5294b79b3483d19d7a8009f3595
[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 #include "ata.h"
12
13 enum eSATA_FIS_Types
14 {
15         SATA_FIS_H2DRegister = 0x27,
16         SATA_FIS_D2HRegister = 0x34,
17         SATA_FIS_DMASetup = 0x41,
18         SATA_FIS_Data = 0x46,
19         SATA_FIS_PIOSetup = 0x5F,
20 };
21
22 struct sSATA_FIS_DMASetup
23 {
24         Uint8   Type;   // = 0x41
25         Uint8   Flags;  // [6]: Interrupt, [5]: Direction
26         Uint8   _resvd1[2];
27         Uint32  DMABufIdLow;
28         Uint32  DMABufIdHigh;
29         Uint32  _resvd2[1];
30         Uint32  DMABufOfs;
31         Uint32  DMATransferCount;
32         Uint32  _resvd[1];
33 } PACKED;
34 struct sSATA_FIS_Data
35 {
36         Uint8   Type;   // = 0x46
37         Uint8   _resvd[3];
38         Uint32  Data[1];
39 } PACKED;
40 struct sSATA_FIS_PIOSetup
41 {
42         Uint8   Type;   // = 0x5F
43         Uint8   Flags;
44         Uint8   Status;
45         Uint8   Error;
46         Uint8   SectorNum;
47         Uint8   CylLow;
48         Uint8   CylHigh;
49         Uint8   Dev_Head;
50         Uint8   SectorNumExp;
51         Uint8   CylLowExp;
52         Uint8   CylHighExp;
53         Uint8   _resvd1[1];
54         Uint8   SectorCount;
55         Uint8   SectorCountExp;
56         Uint8   _resvd2[1];
57         Uint8   E_Status;
58         Uint16  TransferCount;
59         Uint8   _resvd3[2];
60 } PACKED;
61 struct sSATA_FIS_H2DRegister
62 {
63         Uint8   Type;   // = 0x27
64         Uint8   Flags;  // [7]: Update to command register
65         Uint8   Command;
66         Uint8   Features;
67         Uint8   SectorNum;
68         Uint8   CylLow;
69         Uint8   CylHigh;
70         Uint8   Dev_Head;
71         Uint8   SectorNumExp;
72         Uint8   CylLowExp;
73         Uint8   CylHighExp;
74         Uint8   FeaturesExp;
75         Uint8   SectorCount;
76         Uint8   SectorCountExp;
77         Uint8   _resvd1;
78         Uint8   Control;
79         Uint8   _resvd2[4];
80 } PACKED;
81 struct sSATA_FIS_D2HRegister
82 {
83         Uint8   Type;   // = 0x34
84         Uint8   IntResvd;       // [6]: Interrupt bit
85         Uint8   Status;
86         Uint8   Error;
87         Uint8   SectorNum;
88         Uint8   CylLow;
89         Uint8   CylHigh;
90         Uint8   Dev_Head;
91         Uint8   SectorNumExp;
92         Uint8   CylLowExp;
93         Uint8   CylHighExp;
94         Uint8   _resvd1[1];
95         Uint8   SectorCount;
96         Uint8   SectorCountExp;
97         Uint8   _resvd[6];
98 } PACKED;
99 struct sSATA_FIS_SDB
100 {
101         Uint8   Type;   // = 0xA1
102         Uint8   IntResvd;
103         Uint8   Status;
104         Uint8   Error;
105         Uint32  _resvd[1];
106 } PACKED;
107
108 #endif
109

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