69a8e406c6
Adds impl UsbHostController for XhciAdapter<N>, closing the architectural gap
where UHCI/OHCI/EHCI all implement the trait but xhcid used an ad-hoc scheme.
Design:
- XhciAdapter holds Arc<Xhci<N>> (xhci already uses interior mutability:
Mutex/CHashMap/Atomic for all state, so &mut self trait methods are
satisfied by delegating to &self Arc methods)
- port_status: maps xHCI PortFlags (CCS/PED/OCA/PR/PP) + speed + link state
into usb_core::PortStatus
- port_reset: delegates to existing reset_port(PortId) with usize-to-PortId
conversion (root ports only, route_string=0)
- Transfer methods (control/bulk/interrupt) are stubbed with Unsupported —
xhci handles enumeration internally via attach_device(), and class
drivers communicate through the scheme IPC, not trait methods
- set_address returns true (SET_ADDRESS is sent via control_transfer,
handled internally by attach_device, like UHCI's approach)
main.rs updated to use usb_core::scheme_path() for consistent scheme naming
(replaces hardcoded format!("usb.{}", name)).
usb-core added as path dependency to xhcid (no workspace member needed —
Cargo allows path deps outside the workspace root).
N=0 for P1-A; control/bulk/interrupt transfer trait bridges deferred to
the usb-core unified enumeration loop follow-up.
42 lines
902 B
TOML
42 lines
902 B
TOML
[package]
|
|
name = "xhcid"
|
|
description = "xHCI controller driver"
|
|
version = "0.1.0"
|
|
edition = "2018"
|
|
|
|
[[bin]]
|
|
name = "xhcid"
|
|
path = "src/main.rs"
|
|
|
|
[lib]
|
|
name = "xhcid_interface"
|
|
path = "src/lib.rs"
|
|
|
|
[dependencies]
|
|
bitflags.workspace = true
|
|
chashmap = "2.2.2"
|
|
crossbeam-channel = "0.4"
|
|
futures = "0.3"
|
|
plain.workspace = true
|
|
lazy_static = "1.4"
|
|
log.workspace = true
|
|
redox_event.workspace = true
|
|
redox-scheme.workspace = true
|
|
scheme-utils = { path = "../../../scheme-utils" }
|
|
redox_syscall.workspace = true
|
|
serde.workspace = true
|
|
serde_json.workspace = true
|
|
smallvec = { workspace = true, features = ["serde"] }
|
|
thiserror.workspace = true
|
|
toml.workspace = true
|
|
|
|
common = { path = "../../common" }
|
|
daemon = { path = "../../../daemon" }
|
|
pcid = { path = "../../pcid" }
|
|
libredox.workspace = true
|
|
regex = "1.10.6"
|
|
usb-core = { path = "../../../../../recipes/drivers/usb-core/source" }
|
|
|
|
[lints]
|
|
workspace = true
|