X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Finclude%2Fdrv_pci.h;h=33c4a3ecfc41c6901416d5b4b00ebaaceb8f4a24;hb=5f2024e5977e0cca0993a20dad5ab794c94d5711;hp=d3eb8a27f8865ab749e632cf304d9449a3609331;hpb=cf4418f1fcdd441e639d6b95afda42dd74db5f7c;p=tpg%2Facess2.git diff --git a/Kernel/include/drv_pci.h b/Kernel/include/drv_pci.h index d3eb8a27..33c4a3ec 100644 --- a/Kernel/include/drv_pci.h +++ b/Kernel/include/drv_pci.h @@ -29,25 +29,33 @@ enum ePCIClasses enum ePCIOverClasses { - PCI_OC_PCIBRIDGE = 0x0604, - PCI_OC_SCSI = 0x0100 + PCI_OC_PCIBRIDGE = 0x060400, + PCI_OC_SCSI = 0x010000 }; +typedef int tPCIDev; + /** * \brief Count PCI Devices * * Counts the number of devices with specified Vendor and Device IDs */ -extern int PCI_CountDevices(Uint16 vendor, Uint16 device, Uint16 fcn); - -extern int PCI_GetDevice(Uint16 vendor, Uint16 device, Uint16 fcn, int idx); -extern int PCI_GetDeviceByClass(Uint16 class, Uint16 mask, int prev); -extern Uint8 PCI_GetIRQ(int id); -extern Uint32 PCI_GetBAR0(int id); -extern Uint32 PCI_GetBAR1(int id); -extern Uint32 PCI_GetBAR3(int id); -extern Uint32 PCI_GetBAR4(int id); -extern Uint32 PCI_GetBAR5(int id); -extern Uint16 PCI_AssignPort(int id, int bar, int count); +extern int PCI_CountDevices(Uint16 VendorID, Uint16 DeviceID); +extern tPCIDev PCI_GetDevice(Uint16 VendorID, Uint16 DeviceID, int index); +/** + * \param ClassCode (Class:SubClass:PI) + */ +extern tPCIDev PCI_GetDeviceByClass(Uint32 ClassCode, Uint32 Mask, tPCIDev prev); + +extern int PCI_GetDeviceInfo(tPCIDev id, Uint16 *Vendor, Uint16 *Device, Uint32 *Class); +extern int PCI_GetDeviceVersion(tPCIDev id, Uint8 *Revision); +extern int PCI_GetDeviceSubsys(tPCIDev id, Uint16 *SubsystemVendor, Uint16 *SubsystemID); + +extern Uint32 PCI_ConfigRead(tPCIDev id, int Offset, int Size); +extern void PCI_ConfigWrite(tPCIDev id, int Offset, int Size, Uint32 Value); + +extern Uint8 PCI_GetIRQ(tPCIDev id); +extern Uint32 PCI_GetBAR(tPCIDev id, int BAR); +//extern Uint16 PCI_AssignPort(tPCIDev id, int bar, int count); #endif