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_INFOanswer’s binding generation starts. - INFO_
WHERE_ AT - Where the optional part of an
OP_INFOanswer 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 (ehciholds 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’soutth 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 (dwc2takes it;xhciandehcianswerST_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).