danos/system
Daniel Samson 92b03b8d07
usb: recognize and configure hubs, power downstream ports (B4a)
First slice of hub support (docs/usb-hub.md), handled IN the xhci-bus
because a device behind a hub is reached by the CONTROLLER via a route
string in its slot context — topology only exists inside the driver
that owns the controller. When the scan enumerates a class-9 device it
now calls setupHub: read the hub descriptor for the downstream port
count and TT arrangement, tell the controller the slot is a hub
(Configure Endpoint with the slot add-flag sets the Hub bit, Number of
Ports, and MTT/TT-Think-Time per xHCI 4.6.6), SET_HUB_DEPTH for a
SuperSpeed hub so it can compose route strings, and SET_FEATURE
PORT_POWER every downstream port.

The Device gains topology fields (route string, root port, parent hub
slot/port for the TT) and buildAddressInputContext now fills them, so
the Address Device path is ready for downstream devices — those are
enumerated in B4b. A root-port device gets route 0 and its own port as
the chain root, unchanged behavior.

Verified in QEMU with a hub on a second controller and a device behind
it (a usb-hub QEMU case, since the boot controller's auto-assigned
devices collide on the low ports): 'hub slot 1: 8 downstream ports
powered (USB2 single-TT)'. Full suite 89/89. The user's SuperSpeed
Genesys hub is the real-hardware target, flagged separately (QEMU's
USB2 hub doesn't model the compound USB3 hub).
2026-07-21 21:56:59 +01:00
..
devices display: pace the frame clock by the panel's EDID refresh rate 2026-07-21 11:37:29 +01:00
drivers usb: recognize and configure hubs, power downstream ports (B4a) 2026-07-21 21:56:59 +01:00
kernel usb/fat: transfer events matched by slot+endpoint; storage failures heal 2026-07-21 20:27:55 +01:00
services usb/fat: transfer events matched by slot+endpoint; storage failures heal 2026-07-21 20:27:55 +01:00
abi.zig usb/fat: transfer events matched by slot+endpoint; storage failures heal 2026-07-21 20:27:55 +01:00
boot-handoff.zig boot: the /system tree is the system image — loader-built ramdisk, spawn by path 2026-07-21 14:47:26 +01:00
initial-ramdisk.zig boot: survive hand-written sticks — case-fold the /system walk, skip host litter 2026-07-21 18:01:12 +01:00
parameters.zig USB driver stack: xHCI transfers, HID keyboard/mouse, mass storage 2026-07-13 14:11:00 +01:00
vfs-protocol.zig vfs: the root moves into the kernel — resolve + redirect cutover 2026-07-21 16:27:06 +01:00