MCPcopy Index your code
hub / github.com/cyberus-technology/usbvfiod

github.com/cyberus-technology/usbvfiod @v0.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.0 ↗ · + Follow
596 symbols 1,303 edges 48 files 90 documented · 15%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Hercules CI

usbvfiod

usbvfiod is a Rust-based tool designed to enable USB device passthrough to Cloud Hypervisor virtual machines using the vfio-user protocol. Other VMMs might also work, but are currently not the main target.

This project is under active development. We are planning to work on this project in the following order:

  1. Validating our Assumptions (Done)
  2. We are looking for suitable libraries to use and finalize our design.
  3. Towards USB Storage Passthrough (Done)
  4. We build up a virtual XHCI controller and the necessary plumbing to pass-through USB devices from the host.
  5. Our initial test target will be USB storage devices.
  6. Broaden Device Support (Done)
  7. We broaden the set of USB devices we support and actively test.
  8. Our current focus is enabling USB-2 devices and devices with interrupt endpoints.
  9. Hotplug Devices (Done)
  10. We enable attach and detach of exposed devices during runtime.
  11. Stability & Error Recovery (Done)
  12. We seek out points where we currently panic but should not have to panic.
  13. Windows Guest Support (🚧 Ongoing 🚧)
  14. Enable all features required for the Windows xHCI driver to interact with devices through the controller.
  15. Everything Beyond
  16. Many topics remain open. We stay flexible regarding upcoming features.
  17. Missing features include isochronous endpoint support, non-Linux Host support, and support for other VMMs than Cloud Hypervisor.

If you want to use this code in production and need professional support, please get in touch.

Documentation

Find the overview of documentation here.

Funding

This open-source project was developed within the Edge Gateway Platform project and is sponsored by secunet Security Networks AG. This project has received public funding from the European Union NextGenerationEU within the Important Project of Common European Interest – Cloud Infrastructures and Services (IPCEI-CIS) under grant agreement 13IPC022.

Bundesministerium für Wirtschaft und Energie (BMWE)-EU and secunet funding logo

Extension points exported contracts — how you extend this code

BusDevice (Interface)
A device in a memory bus. This receives read/write requests from the memory bus. Reads and writes are assumed to be ato [10 …
src/device/bus.rs
SendWithAnyhowError (Interface)
(no doc) [1 implementers]
src/oneshot_anyhow/mod.rs
TrbData (Interface)
A trait for types offering a higher-level view of raw TRB bytes. All types representing data of TRBs should implement t [13 …
src/device/xhci/trb.rs
BaseEndpointHandle (Interface)
all traits in the endpoint abstractions implement this trait [7 implementers]
src/device/xhci/hotplug_endpoint_handle.rs
SingleThreadedBusDevice (Interface)
A version of [`BusDevice`] that does not mandate thread-safety. This trait is meant for devices that are simple enough [3 …
src/device/bus.rs
InterruptLine (Interface)
An interrupt line with a single operation: [`InterruptLine::interrupt`]. [2 implementers]
src/device/interrupt_line.rs

Core symbols most depended-on inside this repo

enqueue
called by 46
src/device/xhci/event_ring.rs
dummy_trb
called by 45
src/device/xhci/event_ring.rs
try_into
called by 43
src/device/bus.rs
send
called by 41
src/device/xhci/interrupter.rs
send_anyhow
called by 26
src/oneshot_anyhow/mod.rs
write_bulk
called by 25
src/device/bus.rs
parse
called by 21
src/device/xhci/trb.rs
assert_trb_written
called by 20
src/device/xhci/event_ring.rs

Shape

Method 302
Function 140
Class 97
Enum 40
Interface 17

Languages

Rust100%

Modules by API surface

src/device/bus.rs55 symbols
src/device/xhci/trb.rs48 symbols
src/device/register_set.rs44 symbols
src/device/xhci/slot_manager.rs42 symbols
src/device/pci/config_space.rs39 symbols
src/device/xhci/nusb.rs30 symbols
src/device/xhci/port.rs28 symbols
src/device/pcap/packet.rs26 symbols
src/device/xhci/registers.rs21 symbols
src/device/xhci/event_ring.rs18 symbols
src/device/xhci/endpoint_handle.rs16 symbols
src/memory_segment.rs15 symbols

For agents

$ claude mcp add usbvfiod \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page