1 #define MAX_DEVICEBUSES 2
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
9 * It raises a question if our PCI subsystem needs to support this.
10 * However, we'll wait until more use cases pop up.
14 OOP_Object
*ref_Device
;
20 struct Node atapb_Node
;
21 struct PCIDeviceRef
*atapb_Device
;
31 /* These values are used also for ln_Type */
32 #define ATABUSNODEPRI_PROBED 50
33 #define ATABUSNODEPRI_PROBEDLEGACY 100
34 #define ATABUSNODEPRI_LEGACY 0
38 struct ata_ProbedBus
*bus
;
39 OOP_Object
*pciDriver
;
41 void (*ata_HandleIRQ
)(UBYTE
, APTR
);
50 struct MinList probedbuses
;
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
;
66 struct Library
*cs_OOPBase
;
67 struct Library
*cs_UtilityBase
;
70 #undef HiddPCIDeviceAttrBase
71 #undef HiddPCIDriverAttrBase
75 #undef HiddPCIDeviceBase
76 #undef HiddPCIDriverBase
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
);