aboutsummaryrefslogtreecommitdiffstats
path: root/src/usb.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2010-02-28 02:23:19 -0500
committerKevin O'Connor <kevin@koconnor.net>2010-03-09 19:59:25 -0500
commit406fad6fada9fdf1df6c1f627dfadc08452b6b5e (patch)
tree64df5e9193ad2299eaa0bdbf9b2781b06ec49e4d /src/usb.c
parent4547eb904992b12771f040a8c1abc84892a64f98 (diff)
downloadseabios-406fad6fada9fdf1df6c1f627dfadc08452b6b5e.tar.gz
Dynamically allocate USB controller structures.
Have each controller type allocate its own data structure. Also, implement freeing of unused uhci controller structures.
Diffstat (limited to 'src/usb.c')
-rw-r--r--src/usb.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/usb.c b/src/usb.c
index 57d1ad54..95751859 100644
--- a/src/usb.c
+++ b/src/usb.c
@@ -17,8 +17,6 @@
#include "usb.h" // struct usb_s
#include "biosvar.h" // GET_GLOBAL
-struct usb_s USBControllers[16] VAR16VISIBLE;
-
/****************************************************************
* Controller function wrappers
@@ -338,7 +336,6 @@ usb_setup(void)
dprintf(3, "init usb\n");
- memset(&USBControllers, 0, sizeof(USBControllers));
usb_keyboard_setup();
// Look for USB controllers
@@ -350,18 +347,13 @@ usb_setup(void)
if (code >> 8 != PCI_CLASS_SERIAL_USB)
continue;
- struct usb_s *cntl = &USBControllers[count];
- cntl->bdf = bdf;
-
if (code == PCI_CLASS_SERIAL_USB_UHCI)
- run_thread(uhci_init, cntl);
+ uhci_init(bdf, count);
else if (code == PCI_CLASS_SERIAL_USB_OHCI)
- run_thread(ohci_init, cntl);
+ ohci_init(bdf, count);
else
continue;
count++;
- if (count >= ARRAY_SIZE(USBControllers))
- break;
}
}