Start on XHCI struct

This commit is contained in:
Josh Holtrop 2023-06-10 22:55:08 -04:00
parent 238659e94b
commit 37814b4f86
2 changed files with 50 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import hulk.klog;
import hulk.hurl; import hulk.hurl;
import hulk.hurl.a1; import hulk.hurl.a1;
import hulk.range; import hulk.range;
import hulk.usb.xhci;
struct Pci struct Pci
{ {
@ -125,6 +126,35 @@ struct Pci
} }
} }
} }
private void spawn_device_instance()
{
switch (class_id)
{
case SerialBusController.ID:
switch (subclass_id)
{
case SerialBusController.USBController.ID:
switch (if_id)
{
case SerialBusController.USBController.XHCIController.ID:
XHCI.build(&this);
break;
default:
break;
}
break;
default:
break;
}
break;
default:
break;
}
}
} }
struct SerialBusController struct SerialBusController

20
src/hulk/usb/xhci.d Normal file
View File

@ -0,0 +1,20 @@
module hulk.usb.xhci;
import hulk.pci;
import hulk.hurl.a1;
struct XHCI
{
void initialize(Pci.Device * pci_device)
{
}
static void build(Pci.Device * pci_device)
{
if (pci_device.memory_ranges[0].address != null)
{
XHCI * xhci = A1.allocate!XHCI();
xhci.initialize(pci_device);
}
}
}