Skip to main content

Module usbdev

Module usbdev 

Source
Expand description

A USB host’s report to the supervisor about a device it does not drive itself, so the supervisor can start that device’s driver when it arrives and stop it when it leaves (docs/usb-device-drivers.md).

The host reports FACTS - present or not, VID:PID, how many times it has bound one - and never names a driver: which driver a device gets is the supervisor’s table. Sent with try_send and never answered, so a host never waits on the supervisor (8.9). Each report is the host’s whole state for that device, not a change, so a duplicate is harmless and a lost one is corrected by the next.

Structs§

Report
One report. gen counts every bind on that host, so the same dongle bound again - a replug, or the host re-enumerating it - reads differently from the same dongle still bound.

Constants§

ASK
Supervisor to host, one byte and no reply capability: send your report again. How a respawned supervisor learns what is attached (6.2). In the host’s request space beside usbfn’s ops (0x20 up), clear of them and of every block and net op.
HOSTS
How many host numbers there are: a table indexed by one is this long.
HOST_DWC2
Which host a report is from: a PC has two that bind a device for a driver of its own, xhci and ehci, and each reports only what IT has bound - so “nothing attached” from one says nothing of the other’s.
HOST_EHCI
HOST_XHCI
LEN
REPORT
The report’s opcode, after supcmd::MARKER: [MARKER, REPORT, present, gen(4 LE), vid(2 LE), pid(2 LE), host].

Functions§

decode
None for anything that is not exactly a report.
encode
host_name
The service a host number names, or None for a number that is not one.