summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--payloads/libpayload/drivers/usb/ehci.c2
-rw-r--r--payloads/libpayload/drivers/usb/ohci.c2
-rw-r--r--payloads/libpayload/drivers/usb/uhci.c2
-rw-r--r--payloads/libpayload/drivers/usb/xhci.c2
-rw-r--r--payloads/libpayload/include/usb/usb.h3
5 files changed, 11 insertions, 0 deletions
diff --git a/payloads/libpayload/drivers/usb/ehci.c b/payloads/libpayload/drivers/usb/ehci.c
index 8d84f8dd60..4d0a209977 100644
--- a/payloads/libpayload/drivers/usb/ehci.c
+++ b/payloads/libpayload/drivers/usb/ehci.c
@@ -635,6 +635,8 @@ ehci_init (pcidev_t addr)
pci_command = (pci_command | PCI_COMMAND_MEMORY) & ~PCI_COMMAND_IO ;
pci_write_config32(addr, PCI_COMMAND, pci_command);
+ controller->type = EHCI;
+
controller->start = ehci_start;
controller->stop = ehci_stop;
controller->reset = ehci_reset;
diff --git a/payloads/libpayload/drivers/usb/ohci.c b/payloads/libpayload/drivers/usb/ohci.c
index 2cfabb4d4d..570851559e 100644
--- a/payloads/libpayload/drivers/usb/ohci.c
+++ b/payloads/libpayload/drivers/usb/ohci.c
@@ -102,6 +102,8 @@ ohci_init (pcidev_t addr)
if(!controller->instance)
fatal("Not enough memory creating USB controller instance.\n");
+ controller->type = OHCI;
+
controller->start = ohci_start;
controller->stop = ohci_stop;
controller->reset = ohci_reset;
diff --git a/payloads/libpayload/drivers/usb/uhci.c b/payloads/libpayload/drivers/usb/uhci.c
index 78f7aba2dc..84b461a466 100644
--- a/payloads/libpayload/drivers/usb/uhci.c
+++ b/payloads/libpayload/drivers/usb/uhci.c
@@ -147,6 +147,8 @@ uhci_init (pcidev_t addr)
if(!controller->instance)
fatal("Not enough memory creating USB controller instance.\n");
+ controller->type = UHCI;
+
controller->start = uhci_start;
controller->stop = uhci_stop;
controller->reset = uhci_reset;
diff --git a/payloads/libpayload/drivers/usb/xhci.c b/payloads/libpayload/drivers/usb/xhci.c
index a25cf403a0..828e0eaec7 100644
--- a/payloads/libpayload/drivers/usb/xhci.c
+++ b/payloads/libpayload/drivers/usb/xhci.c
@@ -63,6 +63,8 @@ xhci_init (pcidev_t addr)
if(!controller->instance)
fatal("Not enough memory creating USB controller instance.\n");
+ controller->type = XHCI;
+
controller->start = xhci_start;
controller->stop = xhci_stop;
controller->reset = xhci_reset;
diff --git a/payloads/libpayload/include/usb/usb.h b/payloads/libpayload/include/usb/usb.h
index ecfee54551..27af9bc3a0 100644
--- a/payloads/libpayload/include/usb/usb.h
+++ b/payloads/libpayload/include/usb/usb.h
@@ -111,10 +111,13 @@ struct usbdev {
void (*poll) (usbdev_t *dev);
};
+typedef enum { OHCI = 0, UHCI = 1, EHCI = 2, XHCI = 3} hc_type;
+
struct usbdev_hc {
struct usbdev_hc *next;
pcidev_t bus_address;
u32 reg_base;
+ hc_type type;
usbdev_t *devices[128]; // dev 0 is root hub, 127 is last addressable
void (*start) (hci_t *controller);
void (*stop) (hci_t *controller);