BarryServer : Git

All the code for all my projects
// BarryServer : Git / Orion / commit / 1628fcfdfdf2978ed9ccac96ee7d13bb3dc43a01 / drivers / drivers.c

// Related

Orion

Barry Keyboard/Mouse drivers + POSIX names for structs 1628fcf (2 years, 4 months ago)
diff --git a/drivers/drivers.c b/drivers/drivers.c
index 5ae8c4b..1a2fa8d 100644
--- a/drivers/drivers.c
+++ b/drivers/drivers.c
@@ -29,6 +29,9 @@ Device devices[] = {
 	{0x10ec, 0x8139, "Realtek RTL8139 10/100 NIC", rtl8139_init},
 	{0x8086, 0x100e, "Intel Pro 1000/MT NIC", NULL},
 
+	/* Virtual devices */
+	{0x1b36, 0x000d, "QEMU XHCI Host Adapter", xhci_init},
+
 	/* VGA devices */
 	{0x1234, 0x1111, "QEMU/Bochs VBE Framebuffer", bga_init},
 };
@@ -76,6 +79,7 @@ init_drivers(void)
 {
 	uint16_t bus, slot, func;
 	uint16_t vendor, device;
+	uint8_t class, subclass;
 	uint32_t dev;
 	kprintf("Enumerating PCI devices");
 	for (bus = 0; bus < 256; bus++)
@@ -95,8 +99,11 @@ init_drivers(void)
 		}
 		if (devices[dev].vendor != vendor
 		 || devices[dev].device != device) {
-			kprintf("  PCI(%d,%d,%d) = %#x:%#x",
-			        bus, slot, func, vendor, device);
+			class = pci_read_byte(bus, slot, func, 11);
+			subclass = pci_read_byte(bus, slot, func, 10);
+			kprintf("  PCI(%d,%d,%d) = %#.4x:%#.4x (%#.2x, %#.2x)",
+			        bus, slot, func, vendor, device,
+			        class, subclass);
 		}
 	}
 }