revert between 56095 -> 55830 in arch
[AROS.git] / rom / hidds / ata_pci / bus_class.h
blob2fb5d0f117718f3ea344d57e9196a341ba394b78
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 OOP_Object *atapb_Parent;
22 struct PCIDeviceRef *atapb_Device;
23 UWORD atapb_Vendor;
24 UWORD atapb_Product;
25 UBYTE atapb_BusNo;
26 IPTR atapb_IOBase;
27 IPTR atapb_IOAlt;
28 IPTR atapb_INTLine;
29 IPTR atapb_DMABase;
32 /* These values are used also for ln_Type */
33 #define ATABUSNODEPRI_PROBED 50
34 #define ATABUSNODEPRI_PROBEDLEGACY 100
35 #define ATABUSNODEPRI_LEGACY 0
37 struct PCIATABusData
39 struct ata_ProbedBus *bus;
40 OOP_Object *pciDriver;
41 APTR dmaBuf;
42 void (*ata_HandleIRQ)(UBYTE, APTR);
43 APTR irqData;
44 APTR irqHandle;
47 struct atapciBase
49 struct Library lib;
51 struct MinList probedbuses;
52 ULONG ata__buscount;
53 ULONG legacycount;
55 OOP_Class *ataClass;
56 OOP_Class *busClass;
58 OOP_Object *storageRoot;
60 #if defined(__OOP_NOATTRBASES__)
61 OOP_AttrBase PCIDeviceAttrBase;
62 OOP_AttrBase PCIDriverAttrBase;
63 OOP_AttrBase hiddAttrBase;
64 OOP_AttrBase busAttrBase;
65 OOP_AttrBase ATABusAttrBase;
66 OOP_AttrBase hwAttrBase;
67 #endif
68 #if defined(__OOP_NOMETHODBASES__)
69 OOP_MethodID PCIMethodBase;
70 OOP_MethodID PCIDeviceMethodBase;
71 OOP_MethodID PCIDriverMethodBase;
72 OOP_MethodID HWMethodBase;
73 OOP_MethodID HiddSCMethodBase;
74 #endif
76 APTR cs_KernelBase;
77 struct Library *cs_OOPBase;
78 struct Library *cs_UtilityBase;
81 #if defined(__OOP_NOATTRBASES__)
82 /* Attribute Bases ... */
83 #undef HiddPCIDeviceAttrBase
84 #undef HiddPCIDriverAttrBase
85 #undef HiddAttrBase
86 #undef HiddBusAB
87 #undef HiddATABusAB
88 #undef HWAttrBase
89 #define HiddPCIDeviceAttrBase (base->PCIDeviceAttrBase)
90 #define HiddPCIDriverAttrBase (base->PCIDriverAttrBase)
91 #define HiddAttrBase (base->hiddAttrBase)
92 #define HiddBusAB (base->busAttrBase)
93 #define HiddATABusAB (base->ATABusAttrBase)
94 #define HWAttrBase (base->hwAttrBase)
95 #endif
97 #if defined(__OOP_NOMETHODBASES__)
98 /* Method Bases ... */
99 #undef HiddPCIBase
100 #undef HiddPCIDeviceBase
101 #undef HiddPCIDriverBase
102 #undef HWBase
103 #undef HiddStorageControllerBase
104 #define HiddPCIBase (base->PCIMethodBase)
105 #define HiddPCIDeviceBase (base->PCIDeviceMethodBase)
106 #define HiddPCIDriverBase (base->PCIDriverMethodBase)
107 #define HWBase (base->HWMethodBase)
108 #define HiddStorageControllerBase (base->HiddSCMethodBase)
109 #endif
111 /* Libraries ... */
112 #define KernelBase (base->cs_KernelBase)
113 #define OOPBase (base->cs_OOPBase)
114 #define UtilityBase (base->cs_UtilityBase)
116 void DeviceFree(struct PCIDeviceRef *ref, struct atapciBase *base);
117 void DeviceUnref(struct PCIDeviceRef *ref, struct atapciBase *base);