Added class and subclass for PCI enumerating
This commit is contained in:
parent
783dc0e697
commit
41560b133d
|
@ -35,11 +35,18 @@
|
||||||
//
|
//
|
||||||
// Device registers offsets
|
// Device registers offsets
|
||||||
//
|
//
|
||||||
#define PCI_REG_VENDOR 0
|
#define PCI_REG_VENDOR 0x00
|
||||||
#define PCI_REG_DEVICE 2
|
#define PCI_REG_DEVICE 0x02
|
||||||
#define PCI_REG_COMMAND 4
|
#define PCI_REG_COMMAND 0x04
|
||||||
#define PCI_REG_STATUS 6
|
#define PCI_REG_STATUS 0x06
|
||||||
//..
|
#define PCI_REG_REVISION 0x08
|
||||||
|
#define PCI_REG_PROGIF 0x09
|
||||||
|
#define PCI_REG_SUBCLASS 0x0A
|
||||||
|
#define PCI_REG_CLASS 0x0B
|
||||||
|
#define PCI_REG_CACHE_LINE_SIZE 0x0C
|
||||||
|
#define PCI_REG_LATENCY_TIMER 0x0D
|
||||||
|
#define PCI_REG_HEADER_TYPE 0x0E
|
||||||
|
#define PCI_REG_BIST 0x0F
|
||||||
#define PCI_REG_BAR0 0x10
|
#define PCI_REG_BAR0 0x10
|
||||||
#define PCI_REG_BAR1 0x14
|
#define PCI_REG_BAR1 0x14
|
||||||
#define PCI_REG_BAR2 0x18
|
#define PCI_REG_BAR2 0x18
|
||||||
|
@ -57,6 +64,10 @@
|
||||||
struct PciDev_t {
|
struct PciDev_t {
|
||||||
ushort vendorID;
|
ushort vendorID;
|
||||||
ushort deviceID;
|
ushort deviceID;
|
||||||
|
|
||||||
|
uchar classID;
|
||||||
|
uchar subclassID;
|
||||||
|
|
||||||
void* configAddr;
|
void* configAddr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,9 @@ void IoPciEnumerate()
|
||||||
for(uchar function = 0; function < 8; function++) {
|
for(uchar function = 0; function < 8; function++) {
|
||||||
ushort vendor = pciReadConfigWord((uchar)bus, device, function, PCI_REG_VENDOR);
|
ushort vendor = pciReadConfigWord((uchar)bus, device, function, PCI_REG_VENDOR);
|
||||||
if(vendor == 0xffff) continue;
|
if(vendor == 0xffff) continue;
|
||||||
DebugLog("PCI device vendor: %x, device: %x\n",
|
DebugLog("PCI device class: %x, subclass: %x, vendor: %x, device: %x\n",
|
||||||
|
pciReadConfigByte((uchar)bus, device, function, PCI_REG_CLASS),
|
||||||
|
pciReadConfigByte((uchar)bus, device, function, PCI_REG_SUBCLASS),
|
||||||
vendor,
|
vendor,
|
||||||
pciReadConfigWord((uchar)bus, device, function, PCI_REG_DEVICE)
|
pciReadConfigWord((uchar)bus, device, function, PCI_REG_DEVICE)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue