usb: recover endpoint 0 after a failed request; report-protocol keyboards
From the first boot on real hardware: a Razer mouse's control transfer failed with a babble, and an ITE controller's late endpoint-0 completion was reported as an "unexpected event" during a command. A failed control transfer left endpoint 0 halted (or, on a timeout, still running with TRBs queued), so every request after it to that device failed too. It is now reset or stopped and its dequeue pointer moved past what was left on the ring. A STALL -- a device declining a request it does not implement -- is logged only on a verbose boot. HID interfaces without the boot subclass were turned away unless they had a pointer. The report descriptor's keyboard page is now read too -- modifier bits, a key array, an NKRO bitmap -- and each report rewritten into the boot layout for the existing path. Checked with QEMU's usb-kbd forced into report protocol: "echo Hi", Shift included, typed and ran. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S1giNvrHTrPMPw7V6x1kQ4
This commit is contained in:
parent
956d8de5d1
commit
27bf91cfe0
3 changed files with 177 additions and 11 deletions
|
|
@ -143,6 +143,8 @@ struct trb {
|
|||
#define TRB_CONFIG_EP 12
|
||||
#define TRB_EVAL_CTX 13
|
||||
#define TRB_RESET_EP 14
|
||||
#define TRB_STOP_EP 15
|
||||
#define TRB_SET_TR_DEQ 16
|
||||
#define TRB_NOOP_CMD 23
|
||||
// Event TRBs
|
||||
#define TRB_XFER_EVENT 32
|
||||
|
|
@ -151,6 +153,8 @@ struct trb {
|
|||
|
||||
#define TRB_CC(status) (((status) >> 24) & 0xFF)
|
||||
#define CC_SUCCESS 1
|
||||
#define CC_BABBLE 3
|
||||
#define CC_STALL 6
|
||||
#define CC_SHORT_PACKET 13
|
||||
|
||||
// Setup Stage transfer type, and Data Stage direction.
|
||||
|
|
|
|||
Loading…
Reference in a new issue