Modules/ATA - Fixed uninitialised variable
[tpg/acess2.git] / KernelLand / Modules / Storage / AHCI / ahci.h
1 /*
2  * Acess2 Kernel - AHCI Driver
3  * - By John Hodge (thePowersGang)
4  *
5  * ahci.h
6  * - Driver header
7  */
8 #ifndef _AHCI__AHCI_H_
9 #define _AHCI__AHCI_H_
10
11 #include "ahci_hw.h"
12 #include <Storage/LVM/include/lvm.h>
13 #include <stdbool.h>
14 #include <mutex.h>
15 #include <semaphore.h>
16 #include <events.h>
17
18 typedef struct sAHCI_Ctrlr      tAHCI_Ctrlr;
19 typedef struct sAHCI_Port       tAHCI_Port;
20
21 struct sAHCI_Ctrlr
22 {
23          int    ID;     // Controller ID
24         
25          int    IRQ;
26         tPAddr  PMemBase;
27         tAHCI_MemSpace  *MMIO;
28         
29         bool    Supports64Bit;
30
31          int    NCS;
32         
33          int    PortCount;
34         tAHCI_Port      *Ports;
35 };
36
37 struct sAHCI_Port
38 {
39          int    Idx;    // Hardware index
40         tAHCI_Ctrlr     *Ctrlr;
41         volatile struct s_port  *MMIO;
42
43         tMutex  lCommandSlots;
44         Uint32  IssuedCommands;
45         volatile struct sAHCI_CmdHdr    *CmdList;
46         struct sAHCI_CmdTable   *CommandTables[32];
47         tThread *CommandThreads[32];
48         volatile struct sAHCI_RcvdFIS   *RcvdFIS;
49
50         tSemaphore      InterruptSem;
51         Uint32  LastIS;
52
53         bool    bHotplug;
54         bool    bPresent;
55         bool    bATAPI;
56
57         void    *LVMHandle;
58         Uint64  SectorCount;
59 };
60
61 #endif
62

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