⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module xhci

Module xhci 

Source
Expand description

xHCI (eXtensible Host Controller Interface) USB 3.x driver

Implements PCI discovery, MMIO register access, Transfer Ring Buffers (TRBs), Command/Event/Transfer rings, device slot management, port handling, USB descriptor parsing, and MSI-X interrupt stubs for xHCI controllers.

xHCI PCI identification: class 0x0C, subclass 0x03, prog-if 0x30.

Structs§

CommandRing
Command Ring: the host controller dequeues command TRBs from here
DeviceSlot
Per-device-slot tracking information
EventRing
Event Ring: the host controller enqueues event TRBs here
EventRingSegmentTableEntry
Event Ring Segment Table Entry (xHCI spec 6.5)
MsixCapability
MSI-X capability structure offsets (within PCI config space)
MsixTableEntry
MSI-X table entry (16 bytes per entry)
RingState
Producer/consumer cycle state for ring buffers
TransferRing
Transfer Ring: per-endpoint ring for bulk/interrupt/control data transfers
Trb
Generic 16-byte Transfer Request Block
XhciCapabilities
xHCI controller capabilities parsed from Capability Registers
XhciConfigDescriptor
Parsed USB Configuration Descriptor header (9 bytes)
XhciController
State of the xHCI controller
XhciDeviceDescriptor
Parsed USB Device Descriptor (18 bytes)
XhciEndpointDescriptor
Parsed USB Endpoint Descriptor (7 bytes)
XhciInterfaceDescriptor
Parsed USB Interface Descriptor (9 bytes)
XhciPciDevice
Information about a discovered xHCI PCI device
XhciPort
xHCI port information

Enums§

EndpointTransferType
Endpoint transfer type
PortSpeed
Port speed as reported by xHCI PORTSC
SetupTransferType
Transfer type for Setup Stage TRB (control DWORD bits 17:16)
SlotState
State of a device slot

Functions§

configure_msix
Configure MSI-X for the xHCI controller.
controller_count
Get the number of discovered xHCI controllers
find_xhci_controllers
Scan the PCI bus for xHCI controllers and return their BAR0 addresses.
init
Initialize the xHCI subsystem.
is_initialized
Check if the xHCI subsystem has been initialized
is_xhci_device
Check if a PCI device is an xHCI controller
msix_interrupt_handler
MSI-X interrupt handler stub.
parse_configuration_descriptors
Parse all descriptors from a full configuration descriptor buffer.

Type Aliases§

InterfaceWithEndpoints
A parsed interface paired with its endpoint descriptors.