XHCI baby steps!
All checks were successful
Build ISO image / build-and-deploy (push) Successful in 3m31s
Build documentation / build-and-deploy (push) Successful in 2m55s

This commit is contained in:
2026-03-22 17:59:54 +01:00
parent 72715d19e0
commit a4c5df8db4
7 changed files with 228 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
#include <device/pci.h>
#include <device/pci_ide.h>
#include <device/pci_info.h>
#include <device/pci_xhci.h>
#include <libk/lengthof.h>
#include <libk/std.h>
#include <libk/string.h>
@@ -12,6 +13,7 @@
static const struct pci_driver_info pci_driver_infos[] = {
{.class = 0x01, .subclass = 0x01, .init = &pci_ide_init},
{.class = 0x0C, .subclass = 0x03, .init = &pci_xhci_init},
};
static spin_lock_t pci_lock = SPIN_LOCK_INIT;
@@ -279,7 +281,9 @@ static void pci_discovery_cb (struct proc* proc, struct reschedule_ctx* rctx,
for (size_t driver = 0; driver < lengthof (pci_driver_infos); driver++) {
if (pci_driver_infos[driver].class == pci_info.class &&
pci_driver_infos[driver].subclass == pci_info.subclass) {
pci_driver_infos[driver].init (proc, rctx, pci_info);
if (!pci_driver_infos[driver].init (proc, rctx, pci_info)) {
DEBUG ("Init failed. Skipping this device!\n");
}
}
}
}