Kernel - Reworked PCI API to be cleaner
[tpg/acess2.git] / Kernel / include / drv_pci.h
index d3eb8a2..9697df0 100644 (file)
@@ -33,21 +33,26 @@ enum ePCIOverClasses
        PCI_OC_SCSI = 0x0100\r
 };\r
 \r
+typedef int    tPCIDev;\r
+\r
 /**\r
  * \brief Count PCI Devices\r
  * \r
  * Counts the number of devices with specified Vendor and Device IDs\r
  */\r
-extern int     PCI_CountDevices(Uint16 vendor, Uint16 device, Uint16 fcn);\r
-\r
-extern int     PCI_GetDevice(Uint16 vendor, Uint16 device, Uint16 fcn, int idx);\r
-extern int     PCI_GetDeviceByClass(Uint16 class, Uint16 mask, int prev);\r
-extern Uint8   PCI_GetIRQ(int id);\r
-extern Uint32  PCI_GetBAR0(int id);\r
-extern Uint32  PCI_GetBAR1(int id);\r
-extern Uint32  PCI_GetBAR3(int id);\r
-extern Uint32  PCI_GetBAR4(int id);\r
-extern Uint32  PCI_GetBAR5(int id);\r
-extern Uint16  PCI_AssignPort(int id, int bar, int count);\r
+extern int     PCI_CountDevices(Uint16 VendorID, Uint16 DeviceID);\r
+extern tPCIDev PCI_GetDevice(Uint16 VendorID, Uint16 DeviceID, int index);\r
+extern tPCIDev PCI_GetDeviceByClass(Uint16 ClassCode, Uint16 Mask, tPCIDev prev);\r
+\r
+extern int     PCI_GetDeviceInfo(tPCIDev id, Uint16 *Vendor, Uint16 *Device, Uint16 *Class);\r
+extern int     PCI_GetDeviceVersion(tPCIDev id, Uint8 *Revision, Uint8 *ProgIF);\r
+extern int     PCI_GetDeviceSubsys(tPCIDev id, Uint16 *SubsystemVendor, Uint16 *SubsystemID);\r
+\r
+extern Uint32  PCI_ConfigRead(tPCIDev id, int Offset, int Size);\r
+extern void    PCI_ConfigWrite(tPCIDev id, int Offset, int Size, Uint32 Value);\r
+\r
+extern Uint8   PCI_GetIRQ(tPCIDev id);\r
+extern Uint32  PCI_GetBAR(tPCIDev id, int BAR);\r
+//extern Uint16        PCI_AssignPort(tPCIDev id, int bar, int count);\r
 \r
 #endif\r

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