diff --git a/src/hulk/pci.d b/src/hulk/pci.d index 398ed42..48244e3 100644 --- a/src/hulk/pci.d +++ b/src/hulk/pci.d @@ -5,6 +5,7 @@ import hulk.klog; import hulk.hurl; import hulk.hurl.a1; import hulk.range; +import hulk.usb.xhci; 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 diff --git a/src/hulk/usb/xhci.d b/src/hulk/usb/xhci.d new file mode 100644 index 0000000..c7ecde2 --- /dev/null +++ b/src/hulk/usb/xhci.d @@ -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); + } + } +}