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.
This commit is contained in:
Martin Whitaker 2022-04-07 17:51:27 +01:00
parent 75bc6822f8
commit 08bbac1065
1 changed files with 2 additions and 0 deletions

View File

@ -339,6 +339,7 @@ static uint8_t get_keycode(const usb_hcd_t *hcd)
outw(UHCI_USBSTS_INT | UHCI_USBSTS_ERR, UHCI_USBSTS);
for (int kbd_idx = 0; kbd_idx < ws->num_keyboards; kbd_idx++) {
uhci_qh_t *kbd_qh = &ws->qh[1 + kbd_idx];
uhci_td_t *kbd_td = &ws->td[3 + kbd_idx];
status = kbd_td->control_status;
@ -361,6 +362,7 @@ static uint8_t get_keycode(const usb_hcd_t *hcd)
// Reenable the TD.
write32(&kbd_td->control_status, kbd_td->driver_data[0]);
write32(&kbd_qh->qe_link_ptr, (uintptr_t)kbd_td | UHCI_LP_TYPE_TD);
}
}