diff options
Diffstat (limited to 'payloads/libpayload/drivers/usb')
-rw-r--r-- | payloads/libpayload/drivers/usb/usbhid.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/payloads/libpayload/drivers/usb/usbhid.c b/payloads/libpayload/drivers/usb/usbhid.c index 8713cf48c8..b96bfe63f5 100644 --- a/payloads/libpayload/drivers/usb/usbhid.c +++ b/payloads/libpayload/drivers/usb/usbhid.c @@ -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); |