X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Finclude%2Fdrv_pci.h;h=9697df0a122789ef39ff698e1be5c87c2077fac5;hb=1314c5a4586315b526d84500d5b2ef5f7800b703;hp=b53943017c1dfaf52a08530b7d4bb1fd22962d6a;hpb=466eda7c917791866a29c253c6c22197faf41bf7;p=tpg%2Facess2.git diff --git a/Kernel/include/drv_pci.h b/Kernel/include/drv_pci.h index b5394301..9697df0a 100644 --- a/Kernel/include/drv_pci.h +++ b/Kernel/include/drv_pci.h @@ -1,12 +1,16 @@ -/* - * Acess 2 - * PCI Bus Driver - * drv_pci.h +/** + * \file drv_pci.h + * \brief PCI Bus Driver + * \author John Hodge (thePowersGang) */ #ifndef _DRV_PCI_H #define _DRV_PCI_H -enum e_PciClasses { +/** + * \brief PCI Class Codes + */ +enum ePCIClasses +{ PCI_CLASS_PRE20 = 0x00, PCI_CLASS_STORAGE, PCI_CLASS_NETWORK, @@ -22,21 +26,33 @@ enum e_PciClasses { PCI_CLASS_SERIALBUS, PCI_CLASS_MISC = 0xFF }; -enum e_PciOverClasses { + +enum ePCIOverClasses +{ PCI_OC_PCIBRIDGE = 0x0604, PCI_OC_SCSI = 0x0100 }; +typedef int tPCIDev; + +/** + * \brief Count PCI Devices + * + * Counts the number of devices with specified Vendor and Device IDs + */ +extern int PCI_CountDevices(Uint16 VendorID, Uint16 DeviceID); +extern tPCIDev PCI_GetDevice(Uint16 VendorID, Uint16 DeviceID, int index); +extern tPCIDev PCI_GetDeviceByClass(Uint16 ClassCode, Uint16 Mask, tPCIDev prev); + +extern int PCI_GetDeviceInfo(tPCIDev id, Uint16 *Vendor, Uint16 *Device, Uint16 *Class); +extern int PCI_GetDeviceVersion(tPCIDev id, Uint8 *Revision, Uint8 *ProgIF); +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 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 Uint8 PCI_GetIRQ(tPCIDev id); +extern Uint32 PCI_GetBAR(tPCIDev id, int BAR); +//extern Uint16 PCI_AssignPort(tPCIDev id, int bar, int count); #endif