Commit Graph

13 Commits

Author SHA1 Message Date
Martin Whitaker
260c113bb2 Detect and ignore the HID keyboard "phantom condition" (excessive roll-over). 2022-05-01 22:40:42 +01:00
Martin Whitaker
ddaa8bff3f uhci: update the data toggle bit when reenabling an interrupt transfer.
For the same reason as the preceeding ehci fix.
2022-05-01 22:05:40 +01:00
Martin Whitaker
97d6c7140d Improved USB keyboard report handling.
A USB keyboard may return key codes in any of the 6 key code array
positions (issue #48). So we have to compare the latest report to
the previous one to detect new key presses and handle rollover. As
the same change is needed for all HCI types, factor out the common
code into the base driver.
2022-05-01 16:44:46 +01:00
Martin Whitaker
84a54ca083 uhci: use multiple TDs for data transfers larger than the max packet size.
Unlike the other USB controllers, a UHCI transfer descriptor can only
request a single packet.
2022-04-11 21:17:09 +01:00
Martin Whitaker
ae2c010610 uhci: fix device speed setting when constructing a transfer descriptor. 2022-04-10 11:53:01 +01:00
Martin Whitaker
4c55182cd0 Disable UHCI legacy support and make sure all UHCI registers are initialised.
The controller reset should set the USBINTR, FRNUM, and SOF registers to
their default values, but set them explicitly just to be sure.
2022-04-09 22:42:59 +01:00
Martin Whitaker
4761b782dd Enable detection of keyboards attached to a UHCI controller. 2022-04-07 18:05:45 +01:00
Martin Whitaker
08bbac1065 uhci: reset the queue head after handling a keyboard interrupt.
When an interrupt transfer completes, the UHCI loads the QELP in the
QH with the link pointer from the TD (which is a null pointer in this
case). We need to set the QELP back to point at the TD to enable the
next interrupt transfer.
2022-04-07 17:51:27 +01:00
Martin Whitaker
75bc6822f8 uhci: set the link pointer terminate bit in the last TD in a queue. 2022-04-07 17:43:39 +01:00
Martin Whitaker
6cfb7e7e83 Miscellaneous fixes to the UHCI driver.
This gets us to the point that a keyboard is detected when running
QEMU with a EHCI/UHCI combination controller and the first keypress
is detected and returned.
2022-04-07 00:31:59 +02:00
Lionel Debroux
e0d42db07c Optimize the code by declaring several functions static in system/ehci.c.
`size memtest_shared` indicates that this saves 200- (x86) / 200+ (x86_64) bytes, but alignment hides the gain.
2022-03-30 11:54:56 +02:00
Martin Whitaker
0873e3b60a Include string.h, not memory.h, when using memcpy and memset.
memory.h is an anachronism, and not present on all systems.
2022-03-11 18:07:01 +00:00
Martin Whitaker
3b183b0bef Add preliminary (untested) code for supporting UHCI. 2022-02-19 16:24:47 +00:00