Skip to main content

Module usbfn

Module usbfn 

Source
Expand description

The USB FUNCTION PROTOCOL’s numbers: what a USB host service (xhci, dwc2, ehci) answers for the one device it binds for a driver of its own, and what that driver asks. A driver package speaks it through gs::driver::bus; the WiFi dongle’s driver through godspeed_wifi::usbfn, which re-exports these and says what each one means in full (sdk/wifi/src/usbfn.rs). Every request starts with its op, and every reply with [op, status].

Constants§

BULK_IN_MAX
The most one bulk IN transfer carries: seven 512-byte high-speed packets, beside the reply’s two bytes.
BULK_OUT_MAX
The most one bulk OUT transfer carries: the rest of a message after the op and the endpoint byte.
CONTROL_MAX
The most data one control transfer carries, either way.
INFO_GEN_AT
Where an OP_INFO answer’s binding generation starts.
INFO_WHERE_AT
Where the optional part of an OP_INFO answer starts (where the device is, from a host that says).
NOTE_BULK_IN
Sent by the host, unanswered: a bulk IN transfer is held - ask OP_BULK_IN.
NOTE_RADIO
Sent by the host, unanswered: the binding changed - ask OP_INFO.
OP_BULK_IN
[op] -> [op, status, transfer...]: the bulk IN transfer the host holds, if any; the IN armed again (ehci holds none: it waits briefly for the device and answers what came).
OP_BULK_OUT
[op, out, transfer...] -> [op, status]: one bulk OUT transfer to the device’s outth bulk OUT endpoint.
OP_CONTROL
[op, setup (8), data out...] -> [op, status, data in...]: one control transfer on the default endpoint.
OP_CONTROL_ONCE
OP_CONTROL, attempted exactly once: the host does not retry it.
OP_INFO
[op] -> [op, status, vid (2 LE), pid (2 LE), gen (4 LE), ...]: which device is bound, and which binding of it.
OP_REPLUG
[op] -> [op, status]: reset the device’s port and bind it afresh (dwc2 takes it; xhci and ehci answer ST_BAD_REQUEST).
OP_SYNC
[op, notice], never answered: names a notice that arrived in place of an answer.
ST_BAD_REQUEST
The request was malformed.
ST_FAILED
The host tried, and the device or the bus did not complete it.
ST_NO_DEVICE
No device is bound on this host.
ST_OK
The transfer was done (or, for OP_INFO, a device is bound).