mirror of
https://github.com/memtest86plus/memtest86plus.git
synced 2025-02-25 18:55:23 -06:00
Add support for USB hubs.
This refactors the USB driver code into a more object-oriented design, with usbkbd.c being the base class and ohci.c and xhci.c being subclasses. This makes the code that performs USB device enumeration independent of the host controller.
This commit is contained in:
@@ -4,23 +4,20 @@
|
||||
/*
|
||||
* Provides support for USB keyboards connected via an XHCI controller.
|
||||
*
|
||||
* Copyright (C) 2021 Martin Whitaker.
|
||||
* Copyright (C) 2021-2022 Martin Whitaker.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "usbkbd.h"
|
||||
|
||||
/*
|
||||
* Initialises the XHCI device found at base_addr, scans all the attached USB
|
||||
* devices, and configures any HID USB keyboard devices it finds to generate
|
||||
* periodic interrupt transfers that report key presses.
|
||||
* periodic interrupt transfers that report key presses. Initialises hcd and
|
||||
* returns true if the device was successfully initialised and one or more
|
||||
* keyboards were found.
|
||||
*/
|
||||
void *xhci_init(uintptr_t base_addr);
|
||||
|
||||
/*
|
||||
* Polls the completed periodic interrupt transfers, stores the keycodes from
|
||||
* any new key press events in an internal queue, and if the keycode queue is
|
||||
* not empty, pops and returns the keycode from the front of the queue.
|
||||
*/
|
||||
uint8_t xhci_get_keycode(void *ws);
|
||||
bool xhci_init(uintptr_t base_addr, usb_hcd_t *hcd);
|
||||
|
||||
#endif // XHCI_H
|
||||
|
||||
Reference in New Issue
Block a user