113 lines
2.8 KiB
C
113 lines
2.8 KiB
C
// pci_classes.c
|
|
// Author: Josh Holtrop
|
|
// Date: 07/21/05
|
|
// Modified: 07/21/05
|
|
// Had to be a C file because g++ doesn't like pci_classes declaration
|
|
|
|
#include "hos_defines.h"
|
|
#include "pci.h"
|
|
|
|
pci_class_t* pci_classes[] =
|
|
{
|
|
(pci_class_t[]) {
|
|
{1, 1, "Generic PCI VGA Device"},
|
|
{0xFF, 0xFF, "Generic PCI Device"}
|
|
},
|
|
(pci_class_t[]) {
|
|
{0, 0, "SCSI Controller"},
|
|
{1, 0xFF, "IDE Controller"},
|
|
{2, 0, "Floppy Disk Controller"},
|
|
{3, 0, "IPI Controller"},
|
|
{4, 0, "RAID Controller"},
|
|
{0xFF, 0xFF, "Generic Mass Storage Controller"}
|
|
},
|
|
(pci_class_t[]) {
|
|
{0, 0, "Ethernet Controller"},
|
|
{1, 0, "Token Ring Network Controller"},
|
|
{2, 0, "FDDI Controller"},
|
|
{3, 0, "ATM Controller"},
|
|
{0xFF, 0xFF, "Generic Network Controller"}
|
|
},
|
|
(pci_class_t[]) {
|
|
{0, 0, "VGA Compatible Controller"},
|
|
{0, 1, "8514 Compatible Display Controller"},
|
|
{1, 0, "XGA Controller"},
|
|
{0xFF, 0xFF, "Generic Display Controller"}
|
|
},
|
|
(pci_class_t[]) {
|
|
{0, 0, "Multimedia Video Device"},
|
|
{0, 0, "Multimedia Audio Device"},
|
|
{0xFF, 0xFF, "Generic Multimedia Device"}
|
|
},
|
|
(pci_class_t[]) {
|
|
{0, 0, "RAM Controller"},
|
|
{1, 0, "Flash Memory Controller"},
|
|
{0xFF, 0xFF, "Generic Memory Controller"}
|
|
},
|
|
(pci_class_t[]) {
|
|
{0, 0, "Host/PCI Bridge"},
|
|
{1, 0, "PCI/ISA Bridge"},
|
|
{2, 0, "PCI/EISA Bridge"},
|
|
{3, 0, "PCI/Micro Channel Bridge"},
|
|
{4, 0, "PCI/PCI Bridge"},
|
|
{5, 0, "PCI/PCMCIA Bridge"},
|
|
{6, 0, "PCI/NuBus Bridge"},
|
|
{7, 0, "PCI/CardBus Bridge"},
|
|
{0xFF, 0xFF, "Generic Bridge"}
|
|
},
|
|
(pci_class_t[]) {
|
|
{0, 0xFF, "Serial Controller"},
|
|
{1, 0xFF, "Parallel Port"},
|
|
{0xFF, 0xFF, "Generic Communications Device"}
|
|
},
|
|
(pci_class_t[]) {
|
|
{0, 0xFF, "Programmable Interrupt Controller"},
|
|
{1, 0xFF, "DMA Controller"},
|
|
{2, 0xFF, "System Timer"},
|
|
{3, 0xFF, "RTC Controller"},
|
|
{0xFF, 0xFF, "Generic System Peripheral"}
|
|
},
|
|
(pci_class_t[]) {
|
|
{0, 0, "Keyboard Controller"},
|
|
{1, 0, "Digitizer (Pen)"},
|
|
{2, 0, "Mouse Controller"},
|
|
{0xFF, 0xFF, ""}
|
|
},
|
|
(pci_class_t[]) {
|
|
{0xFF, 0xFF, "Docking Station"}
|
|
},
|
|
(pci_class_t[]) {
|
|
{0, 0, "386 Processor"},
|
|
{1, 0, "486 Processor"},
|
|
{2, 0, "Pentium Processor"},
|
|
{0x10, 0, "Alpha Processor"},
|
|
{0x20, 0, "PowerPC Processor"},
|
|
{0x40, 0, "Co-Processor"},
|
|
{0xFF, 0xFF, "Generic Processor"}
|
|
},
|
|
(pci_class_t[]) {
|
|
{0, 0, "Firewire (IEEE 1394) Controller"},
|
|
{1, 0, "ACCESS Bus Controller"},
|
|
{2, 0, "SSA (Serial Storage Architecture) Controller"},
|
|
{3, 0, "USB Controller"},
|
|
{0xFF, 0xFF, "Generic Serial Bus Controller"}
|
|
}
|
|
};
|
|
|
|
char *pci_getDeviceClass(u8_t cls, u8_t sub, u8_t progif)
|
|
{
|
|
if (cls < sizeof(pci_classes)/sizeof(pci_class_t *))
|
|
{
|
|
pci_class_t *pcls = pci_classes[cls];
|
|
for (;;)
|
|
{
|
|
if ( (pcls->subclass == 0xFF || pcls->subclass == sub)
|
|
&& (pcls->progif == 0xFF || pcls->progif == progif) )
|
|
return pcls->desc;
|
|
pcls++;
|
|
}
|
|
}
|
|
return "Unknown PCI Device";
|
|
}
|
|
|