Sorting source tree a bit
[tpg/acess2.git] / KernelLand / Kernel / include / drv_pci.h
1 /**\r
2  * \file drv_pci.h\r
3  * \brief PCI Bus Driver\r
4  * \author John Hodge (thePowersGang)\r
5  */\r
6 #ifndef _DRV_PCI_H\r
7 #define _DRV_PCI_H\r
8 \r
9 /**\r
10  * \brief PCI Class Codes\r
11  */\r
12 enum ePCIClasses\r
13 {\r
14         PCI_CLASS_PRE20 = 0x00,\r
15         PCI_CLASS_STORAGE,\r
16         PCI_CLASS_NETWORK,\r
17         PCI_CLASS_DISPLAY,\r
18         PCI_CLASS_MULTIMEDIA,\r
19         PCI_CLASS_MEMORY,\r
20         PCI_CLASS_BRIDGE,\r
21         PCI_CLASS_COMM,\r
22         PCI_CLASS_PREPH,\r
23         PCI_CLASS_INPUT,\r
24         PCI_CLASS_DOCKING,\r
25         PCI_CLASS_PROCESSORS,\r
26         PCI_CLASS_SERIALBUS,\r
27         PCI_CLASS_MISC = 0xFF\r
28 };\r
29 \r
30 enum ePCIOverClasses\r
31 {\r
32         PCI_OC_PCIBRIDGE = 0x060400,\r
33         PCI_OC_SCSI = 0x010000\r
34 };\r
35 \r
36 typedef int     tPCIDev;\r
37 \r
38 /**\r
39  * \brief Count PCI Devices\r
40  * \r
41  * Counts the number of devices with specified Vendor and Device IDs\r
42  */\r
43 extern int      PCI_CountDevices(Uint16 VendorID, Uint16 DeviceID);\r
44 extern tPCIDev  PCI_GetDevice(Uint16 VendorID, Uint16 DeviceID, int index);\r
45 /**\r
46  * \param ClassCode (Class:SubClass:PI)\r
47  */\r
48 extern tPCIDev  PCI_GetDeviceByClass(Uint32 ClassCode, Uint32 Mask, tPCIDev prev);\r
49 \r
50 extern int      PCI_GetDeviceInfo(tPCIDev id, Uint16 *Vendor, Uint16 *Device, Uint32 *Class);\r
51 extern int      PCI_GetDeviceVersion(tPCIDev id, Uint8 *Revision);\r
52 extern int      PCI_GetDeviceSubsys(tPCIDev id, Uint16 *SubsystemVendor, Uint16 *SubsystemID);\r
53 \r
54 extern Uint32   PCI_ConfigRead(tPCIDev id, int Offset, int Size);\r
55 extern void     PCI_ConfigWrite(tPCIDev id, int Offset, int Size, Uint32 Value);\r
56 \r
57 extern Uint8    PCI_GetIRQ(tPCIDev id);\r
58 extern Uint32   PCI_GetBAR(tPCIDev id, int BAR);\r
59 //extern Uint16 PCI_AssignPort(tPCIDev id, int bar, int count);\r
60 \r
61 #endif\r

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