This patch removes most of the #ifdefs in libc/console.c, and
replaces it with two queues (input, output) where drivers (serial, keyboard, video, usb) can attach. The only things left with #ifdefs are initialization (at some point the drivers must get a chance to register) Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Jordan Crouse <jordan.crouse@amd.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3679 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
@@ -145,10 +145,21 @@ usb_hid_set_protocol (usbdev_t *dev, interface_descriptor_t *interface, hid_prot
|
||||
dev->controller->control (dev, OUT, sizeof (dev_req_t), &dr, 0, 0);
|
||||
}
|
||||
|
||||
static struct console_input_driver cons = {
|
||||
.havekey = usbhid_havechar,
|
||||
.getchar = usbhid_getchar
|
||||
};
|
||||
|
||||
void
|
||||
usb_hid_init (usbdev_t *dev)
|
||||
{
|
||||
|
||||
static int installed = 0;
|
||||
if (!installed) {
|
||||
installed = 1;
|
||||
console_add_input_driver (&cons);
|
||||
}
|
||||
|
||||
configuration_descriptor_t *cd = (configuration_descriptor_t*)dev->configuration;
|
||||
interface_descriptor_t *interface = (interface_descriptor_t*)(((char *) cd) + cd->bLength);
|
||||
|
||||
|
Reference in New Issue
Block a user