3 * - By John Hodge (thePowersGang)
11 #define PCI_BASE "/Devices/pci"
13 int main(int argc, char *argv[]);
14 void show_device(int PFD, const char *File, int bVerbose);
17 int main(int argc, char *argv[])
19 int fd = _SysOpen(PCI_BASE, OPENFLAG_READ);
23 while( _SysReadDir(fd, name) )
25 if(name[0] == '.') continue ;
27 show_device(fd, name, 0);
35 void show_device(int PFD, const char *File, int bVerbose)
47 fd = _SysOpenChild(PFD, File, OPENFLAG_READ);
49 printf("%s - ERR (open failure)\n", File);
52 rv = _SysRead(fd, &pciinfo, sizeof(pciinfo));
53 if( rv != sizeof(pciinfo) ) {
54 printf("%s - ERR (read %i < %i)\n", File, rv, sizeof(pciinfo));
58 uint32_t class_if = pciinfo.revclass >> 8;
59 uint8_t revision = pciinfo.revclass & 0xFF;
60 printf("%s - %04x:%04x %06x:%02x\n",
62 pciinfo.vendor, pciinfo.device,