add sdcard to raspi BE kernel
[AROS.git] / rom / hidds / ata_pci / bus_class.h
blob90db50f65ed37fb64453cbf169447c929e771985
1 #define MAX_DEVICEBUSES 2
3 /*
4 * A single PCI device is shared between two buses.
5 * The driver is designed as unloadable, so our bus objects can be
6 * destroyed. We need to release the device only when both objects
7 * are disposed, so we maintain this structure with reference
8 * counter.
9 * It raises a question if our PCI subsystem needs to support this.
10 * However, we'll wait until more use cases pop up.
12 struct PCIDeviceRef
14 OOP_Object *ref_Device;
15 ULONG ref_Count;
18 struct ata_ProbedBus
20 struct Node atapb_Node;
21 struct PCIDeviceRef *atapb_Device;
22 UWORD atapb_Vendor;
23 UWORD atapb_Product;
24 UBYTE atapb_BusNo;
25 IPTR atapb_IOBase;
26 IPTR atapb_IOAlt;
27 IPTR atapb_INTLine;
28 IPTR atapb_DMABase;
31 /* These values are used also for ln_Type */
32 #define ATABUSNODEPRI_PROBED 50
33 #define ATABUSNODEPRI_PROBEDLEGACY 100
34 #define ATABUSNODEPRI_LEGACY 0
36 struct ATA_BusData
38 struct ata_ProbedBus *bus;
39 OOP_Object *pciDriver;
40 APTR dmaBuf;
41 void (*ata_HandleIRQ)(UBYTE, APTR);
42 APTR irqData;
43 APTR irqHandle;
46 struct ataBase
48 struct Library lib;
50 struct MinList probedbuses;
51 ULONG ata__buscount;
52 ULONG legacycount;
54 OOP_Class *busClass;
56 OOP_AttrBase PCIDeviceAttrBase;
57 OOP_AttrBase PCIDriverAttrBase;
58 OOP_AttrBase hiddAttrBase;
59 OOP_AttrBase ATABusAttrBase;
60 OOP_MethodID PCIMethodBase;
61 OOP_MethodID PCIDeviceMethodBase;
62 OOP_MethodID PCIDriverMethodBase;
63 OOP_MethodID HWMethodBase;
65 APTR cs_KernelBase;
66 struct Library *cs_OOPBase;
67 struct Library *cs_UtilityBase;
70 #undef HiddPCIDeviceAttrBase
71 #undef HiddPCIDriverAttrBase
72 #undef HiddAttrBase
73 #undef HiddATABusAB
74 #undef HiddPCIBase
75 #undef HiddPCIDeviceBase
76 #undef HiddPCIDriverBase
77 #undef HWBase
78 #define HiddPCIDeviceAttrBase (base->PCIDeviceAttrBase)
79 #define HiddPCIDriverAttrBase (base->PCIDriverAttrBase)
80 #define HiddAttrBase (base->hiddAttrBase)
81 #define HiddATABusAB (base->ATABusAttrBase)
82 #define HiddPCIBase (base->PCIMethodBase)
83 #define HiddPCIDeviceBase (base->PCIDeviceMethodBase)
84 #define HiddPCIDriverBase (base->PCIDriverMethodBase)
85 #define HWBase (base->HWMethodBase)
86 #define KernelBase (base->cs_KernelBase)
87 #define OOPBase (base->cs_OOPBase)
88 #define UtilityBase (base->cs_UtilityBase)
90 void DeviceFree(struct PCIDeviceRef *ref, struct ataBase *base);
91 void DeviceUnref(struct PCIDeviceRef *ref, struct ataBase *base);