Skip to main content

Module scheme

Module scheme 

Source
Expand description

Multi-driver VFS scheme served at /bus/.

Each successfully-initialised bus driver appears as a sub-directory:

/bus/                     -> list of registered driver names + pci/
/bus/pci/inventory        -> PCI device table
/bus/pci/count            -> number of PCI devices
/bus/pci/rescan           -> (write-only) refresh PCI cache
/bus/pci/find/<vid>/<did> -> find devices by vendor/device
/bus/pci/cfg/<b:d.f>/<off>/<w>  -> raw PCI config read
/bus/<driver>/            -> driver info (compatible, errors, โ€ฆ)
/bus/<driver>/status      -> driver status
/bus/<driver>/error_count -> driver error count
/bus/<driver>/reg/<hex>   -> read/write a driver register
                             (NOTE: on software-defined buses without a
                             register file, e.g. `moxtet`, `reg/<idx>` is
                             a logical slot index, not an MMIO offset โ€”
                             see `moxtet::Moxtet` docs)
/bus/<driver>/<child>     -> child-device info (if the driver reports any)

Structsยง

BusSchemeServer
OpenHandle ๐Ÿ”’

Enumsยง

HandleKind ๐Ÿ”’

Constantsยง

DRV_ERROR_COUNT ๐Ÿ”’
DRV_FIREWALL_DIR ๐Ÿ”’
DRV_FIREWALL_INFO ๐Ÿ”’
DRV_REG_PREFIX ๐Ÿ”’
DRV_RESUME ๐Ÿ”’
DRV_STATUS ๐Ÿ”’
Driver-specific paths (relative to the driver prefix).
DRV_SUSPEND ๐Ÿ”’
FIREWALL_GRANT_PREFIX ๐Ÿ”’
FIREWALL_RELEASE_PREFIX ๐Ÿ”’
MAX_FIND_CACHE_ENTRIES ๐Ÿ”’
Upper bound on cached pci/find results.
MAX_HANDLES_PER_SENDER ๐Ÿ”’
Max simultaneously open handles per sender. Without it, one client could fill the global table and starve all others out of the scheme server.
MAX_OPEN_HANDLES ๐Ÿ”’
Upper bound on simultaneously open handles. Prevents a single client from exhausting server memory by opening handles in a loop without closing them (DoS on the scheme server).
PCI_PREFIX ๐Ÿ”’
Top-level paths.
READDIR_DATA_CAPACITY ๐Ÿ”’
Max bytes usable for readdir entries: full payload minus the fixed reply prologue (next_cursor + count + size, written at 4..8).
READDIR_HEADER_SIZE ๐Ÿ”’
Fixed reply prologue of a READDIR reply: status (4) + next_cursor (2) + count (1) + size (1), written at payload offsets 0..8.
READ_DATA_CAPACITY ๐Ÿ”’
Max inline data bytes carried by a READ reply: full payload minus the status/count prefix.
READ_HEADER_SIZE ๐Ÿ”’
Fixed reply prologue of a READ reply: status (4) + count (4).
STATUS_OK ๐Ÿ”’