Artemis Milestone 2f: SET_CONFIGURATION -- 2f complete

Chains off a confirmed Mass Storage/SCSI/BOT interface match via the
existing next_action deferral mechanism: device descriptor -> config
descriptor -> SET_CONFIGURATION is now a single automatic sequence.
bConfigurationValue is read directly out of the already-fetched
config_descriptor buffer, no extra transfer needed.

First write control transfer this driver has issued (every prior one was
a read), so it needed its own submission helper,
xhci_ep0_control_write_nodata() -- SET_CONFIGURATION has no Data Stage
(wLength=0), and per USB 2.0 spec 8.5.3 a no-data control transfer's
Status Stage is always IN, the reverse of an OUT-data request's status
stage. XHCI_SETUP_TRT_NO_DATA already existed in xhci.h, unused until now.

Verified live via QMP hotplug, all three architectures, worked first try,
byte-identical: "set configuration submitted" -> "device configured",
guest stays running throughout (checked via QMP query-status). Disconnect
confirmed clean on every arch afterward, no wedge. FABRIC-2.md Section X
Milestone 2f updated -- 2f is now fully complete, 2g (Bulk-Only Transport)
can start.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QPfdtaXs9ay1nbwuMnrscu
This commit is contained in:
Robert Allan James
2026-08-25 07:40:16 -04:00
co-authored by Claude Sonnet 5
parent b9c540a78b
commit b4bbd043d0
12 changed files with 27309 additions and 9 deletions
+25 -2
View File
@@ -3334,8 +3334,8 @@ command, DCBAA entry clear), and the callback surface into Section U's higher-le
to, Section U item 7's foreign-drive/home-blocks-signature check, which happens one
layer up, after the drive is already known to be USB mass storage) — **done
2026-08-25**, see writeup below
- [ ] Set the device configuration (SET_CONFIGURATION control transfer) — still open, last
item before 2g's bulk transfers are possible
- [x] Set the device configuration (SET_CONFIGURATION control transfer) — **done 2026-08-25**,
see writeup below. **2f is now fully complete** — 2g (Bulk-Only Transport) can start.
**Device descriptor request, done 2026-08-22.** Extends the EP0 Transfer Ring built in 2e's
Address Device work with real control-transfer submission: a new `xhci_ep0_enqueue_trb()`
@@ -3391,6 +3391,29 @@ Verified live via QMP hotplug, all three architectures, byte-identical results e
also confirmed clean on every arch — no wedge, matches 2e's existing disconnect discipline.
`logs/20260825-071717/amd64/`, `logs/20260825-072116/aarch64/`, `logs/20260825-072329/riscv64/`.
**SET_CONFIGURATION, done 2026-08-25 — 2f complete.** Chains directly off a confirmed Mass
Storage/SCSI/BOT interface match in the `XHCI_XFER_CONFIG_DESC_FULL` handler, via the same
`next_action` deferral mechanism as the earlier chains (device descriptor → config descriptor
→ set configuration is now a single automatic sequence with no manual steps in between).
`bConfigurationValue` (offset 5 in the Configuration descriptor, `USB_CONFIG_OFF_CONFIG_VALUE`)
is read directly out of the already-fetched `dev->config_descriptor` — no extra transfer
needed to learn it.
Structurally this is the first *write* control transfer this driver has issued — every prior
one (device descriptor, config descriptor) was a read. SET_CONFIGURATION has no Data Stage at
all (`wLength=0`), so it needed its own submission helper, `xhci_ep0_control_write_nodata()`,
alongside the existing `xhci_ep0_control_read()`: Setup Stage TRT = `XHCI_SETUP_TRT_NO_DATA`
(the constant already existed in `xhci.h`, unused until now), and — per USB 2.0 spec §8.5.3,
"if there is no Data stage, the Status stage is always an IN transaction" — the Status Stage
TRB gets `DIR_IN` set, the reverse of what a normal OUT-data request's status stage would use.
That's a real, spec-mandated asymmetry, not a copy-paste of the read helper's status stage.
Verified live via QMP hotplug, all three architectures, worked first try, byte-identical
results: `xhci: set configuration submitted``xhci: device configured`, guest stays
`running` (checked via QMP `query-status`) throughout. Disconnect confirmed clean on every
arch afterward, no wedge. `logs/20260825-073235/amd64/`, `logs/20260825-073417/aarch64/`,
`logs/20260825-073728/riscv64/`.
**2g. Bulk-Only Transport (BOT) — the actual read/write path**
- [ ] Identify and configure the device's bulk IN and bulk OUT endpoints
- [ ] Implement CBW (Command Block Wrapper) construction and send, for a SCSI READ(10)