P2: later
An appendix to the milestone.
P2: after the first release, or when a lane is there anyway
-
control_max_packetis looser than the specification at two speeds. Finding: below SuperSpeed the function accepts 8, 16, 32 and 64 for any speed. USB 2.0 section 5.5.3 allows only 8 at low speed and only 64 at high speed; the four values are legal at full speed alone. The function takes a boolean, so it cannot know. The function accepts a low-speed keyboard that declares 64, and the controller hears a packet size the device cannot carry. Linux's handling of this case was not checked (unverified). Evidence:crates/universal_serial_bus/src/descriptor.rslines 103 to 117. Change: take the four-waySpeedinstead of a boolean, as Decision 3 decides, provisionally. Door: two-way before the first release. Effort: S. -
Reserved bits of
bEndpointAddresspass through to the caller. Finding:BootKeyboard::endpointis the byte as sent. Scratch test: the crate returns0xf1as0xf1. The specification reserves bits 6:4 and says they reset to zero. The xHCI crate'sendpoint_indexmasks them, so nothing breaks today, but the published value should be the number and the direction and nothing else. Evidence:crates/universal_serial_bus/src/descriptor.rslines 234 and 246. Change:endpoint: address & 0x8f, and one sentence in the field's documentation. Door: two-way. Effort: XS. -
Documentation gaps a stranger meets. Finding:
find_boot_keyboarddoes not say the walk begins at the header's ownbLength, so a header of 18 bytes skips what follows it by the device's own claim (scratch test: answersNoBootKeyboard, which is right but surprising).BootReport::parsedoes not say that it accepts a buffer longer than eight bytes and ignores its tail (scratch test: it does). Thethe_table_matches_its_linux_cross_checktest comment carries a date and a commit, which is the right place for them, but the README (item 4) should carry the same two facts.get_descriptor's parameterindexis the descriptor index inwValuewhile the struct fieldindexiswIndex; one sentence would prevent the misread. Evidence:crates/universal_serial_bus/src/descriptor.rslines 165 to 173 and 208;crates/universal_serial_bus/src/boot_keyboard.rslines 70 to 73;crates/universal_serial_bus/src/request.rslines 43 to 46. Change: four sentences. Door: two-way. Effort: XS. -
Private names the report-only gate lists. Finding:
abbreviations.pyreportsQEMU_USB_KBD,dev,diff,ab,shift_ab,keycapsandevdev. The first five are test locals and the maintainer's;keycapsis a word in this domain;evdevis Linux's own name for its input event interface and stays, with the plain name in the function's documentation. Evidence:crates/universal_serial_bus/src/descriptor.rslines 275 and 415;crates/universal_serial_bus/src/boot_keyboard.rslines 121, 286, 294, 380 and 389. Change:QEMU_USB_KEYBOARD,device,difference,shift_a_b,a_b; the rest stay. Door: two-way. Effort: XS.