class UsbXhci
Defined at line 64 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
Keeps track of events received from the XHCI controller
Public Methods
zx::result<> Start ()
Defined at line 23 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc
void Stop ()
Defined at line 25 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc
void ConnectToEndpoint (ConnectToEndpointRequest & request, ConnectToEndpointCompleter::Sync & completer)
fuchsia_hardware_usb_new.UsbHciNew protocol implementation.
Defined at line 27 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc
void UsbHciRequestQueue (usb_request_t * usb_request, const usb_request_complete_callback_t * complete_cb)
USB HCI protocol implementation.
Control TRBs must be run on the primary interrupter. Section 4.9.4.3: secondary interrupters
cannot handle them..
Defined at line 71 of file ../../src/devices/usb/drivers/xhci/tests/xhci-transfer-ring-test.cc
void UsbHciSetBusInterface (const usb_bus_interface_protocol_t * bus_intf)
Defined at line 32 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc
size_t UsbHciGetMaxDeviceCount ()
Retrieves the max number of device slots supported by this host controller
Defined at line 34 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc
zx_status_t UsbHciEnableEndpoint (uint32_t device_id, const usb_endpoint_descriptor_t * ep_desc, const usb_ss_ep_comp_descriptor_t * ss_com_desc, bool enable)
Defined at line 36 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc
uint64_t UsbHciGetCurrentFrame ()
Defined at line 43 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc
zx_status_t UsbHciConfigureHub (uint32_t device_id, usb_speed_t speed, const usb_hub_descriptor_t * desc, bool multi_tt)
Defined at line 45 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc
zx_status_t UsbHciHubDeviceAdded (uint32_t device_id, uint32_t port, usb_speed_t speed)
Defined at line 49 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc
zx_status_t UsbHciHubDeviceRemoved (uint32_t device_id, uint32_t port)
Defined at line 53 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc
zx_status_t UsbHciHubDeviceReset (uint32_t device_id, uint32_t port)
Defined at line 57 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc
zx_status_t UsbHciResetEndpoint (uint32_t device_id, uint8_t ep_address)
Defined at line 61 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc
zx_status_t UsbHciResetDevice (uint32_t hub_address, uint32_t device_id)
Defined at line 65 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc
size_t UsbHciGetMaxTransferSize (uint32_t device_id, uint8_t ep_address)
Defined at line 69 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc
size_t UsbHciGetRequestSize ()
Defined at line 71 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc
zx::result<> Init (std::unique_ptr<dma_buffer::BufferFactory> buffer_factory)
UsbXhci Methods
Defined at line 41 of file ../../src/devices/usb/drivers/xhci/tests/xhci-transfer-ring-test.cc
zx::result<> TestInit (void * test_harness)
Static Default Implementations
Defined at line 18 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc
void UsbXhci (fdf::DriverStartArgs start_args, fdf::UnownedSynchronizedDispatcher driver_dispatcher)
Defined at line 71 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
zx_status_t UsbHciCancelAll (uint32_t device_id, uint8_t ep_address)
Defined at line 74 of file ../../src/devices/usb/drivers/xhci/tests/xhci-transfer-ring-test.cc
void SetInterface (SetInterfaceRequest & request, SetInterfaceCompleter::Sync & completer)
Stubs for FIDL HCI
Defined at line 88 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
void GetMaxDeviceCount (GetMaxDeviceCountCompleter::Sync & completer)
Defined at line 92 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
void EnableEndpoint (EnableEndpointRequest & request, EnableEndpointCompleter::Sync & completer)
Defined at line 96 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
void GetCurrentFrame (GetCurrentFrameCompleter::Sync & completer)
Defined at line 101 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
void ConfigureHub (ConfigureHubRequest & request, ConfigureHubCompleter::Sync & completer)
Defined at line 105 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
void HubDeviceAdded (HubDeviceAddedRequest & request, HubDeviceAddedCompleter::Sync & completer)
Defined at line 109 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
void HubDeviceRemoved (HubDeviceRemovedRequest & request, HubDeviceRemovedCompleter::Sync & completer)
Defined at line 114 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
void HubDeviceReset (HubDeviceResetRequest & request, HubDeviceResetCompleter::Sync & completer)
Defined at line 119 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
void ResetEndpoint (ResetEndpointRequest & request, ResetEndpointCompleter::Sync & completer)
Defined at line 124 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
void ResetDevice (ResetDeviceRequest & request, ResetDeviceCompleter::Sync & completer)
Defined at line 129 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
void GetMaxTransferSize (GetMaxTransferSizeRequest & request, GetMaxTransferSizeCompleter::Sync & completer)
Defined at line 133 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
void RequestQueue (usb_request_t * usb_request, const usb_request_complete_callback_t * complete_cb)
Queues a USB request (compatibility shim for usb::CallbackRequest in unit test)
Defined at line 162 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
fpromise::promise<OwnedRequest, void> UsbHciRequestQueue (OwnedRequest usb_request)
Queues a request and returns a promise
Defined at line 180 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc
fpromise::promise<void, zx_status_t> UsbHciDisableEndpoint (uint32_t device_id, uint8_t ep_addr)
Defined at line 144 of file ../../src/devices/usb/drivers/xhci/tests/xhci-endpoint-test.cc
bool Running ()
Defined at line 153 of file ../../src/devices/usb/drivers/xhci/tests/xhci-endpoint-test.cc
fpromise::promise<void, zx_status_t> DisableSlotCommand (uint32_t slot_id)
Disables a slot
Defined at line 122 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc
fpromise::promise<void, zx_status_t> DisableSlotCommand (DeviceState & state)
Defined at line 132 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc
TRBPromise EnableSlotCommand ()
Defined at line 173 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc
void RingDoorbell (uint8_t slot, uint8_t target)
Defined at line 154 of file ../../src/devices/usb/drivers/xhci/tests/xhci-endpoint-test.cc
bool IsDeviceConnected (uint8_t slot)
Returns whether or not a device is connected to the root hub.
Always returns true for devices attached via a hub.
Defined at line 192 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
size_t slot_size_bytes ()
Defined at line 218 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
uint8_t CapLength ()
Returns the value in the CAPLENGTH register
Defined at line 221 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
uint8_t DeviceIdToSlotId (uint8_t device_id)
Defined at line 223 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
uint8_t SlotIdToDeviceId (uint8_t slot_id)
Defined at line 225 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
uint8_t GetPortCount ()
Defined at line 229 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
void WaitForBringup ()
Waits for xHCI bringup to complete
Defined at line 235 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
CommandRing * GetCommandRing ()
Defined at line 237 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
fbl::Array<fbl::RefPtr<DeviceState>> & GetDeviceState ()
Defined at line 239 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
PortState * GetPortState ()
Defined at line 241 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
bool HasCoherentCache ()
Indicates whether or not the controller supports cache coherency
for transfers.
Defined at line 244 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
bool HasCoherentState ()
Indicates whether or not the controller has a cache coherent state.
Currently, this is the same as HasCoherentCache, but the spec
leaves open the possibility that a controller may have a coherent cache,
but not a coherent state.
Defined at line 249 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
bool IsQemu ()
Returns whether or not we are running in Qemu. Quirks need to be applied
where the emulated controller violates the xHCI specification.
Defined at line 252 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
void ScheduleTask (uint16_t target_interrupter, TRBPromise promise)
Schedules a promise for execution on the executor
Defined at line 255 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
void ScheduleTask (uint16_t target_interrupter, fpromise::promise<void, zx_status_t> promise)
Schedules a promise for execution on the executor
Defined at line 260 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
template <typename V>
zx_status_t RunSynchronously (uint16_t target_interrupter, fpromise::promise<V, zx_status_t> promise)
Schedules the promise for execution and synchronously waits for it to complete
Defined at line 266 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
void Shutdown (zx_status_t status)
Forces an immediate shutdown of the HCI
This should only be called for critical errors that cannot
be recovered from.
Defined at line 299 of file ../../src/devices/usb/drivers/xhci/tests/xhci-event-ring-test.cc
fpromise::promise<void, zx_status_t> UsbHciResetEndpointAsync (uint32_t device_id, uint8_t ep_address)
Defined at line 270 of file ../../src/devices/usb/drivers/xhci/tests/xhci-event-ring-test.cc
fpromise::promise<void, zx_status_t> DeviceOffline (uint32_t slot)
Offlines a device slot, removing its device node from the topology.
Defined at line 295 of file ../../src/devices/usb/drivers/xhci/tests/xhci-event-ring-test.cc
zx_status_t DeviceOnline (uint32_t slot, uint16_t port, usb_speed_t speed)
Onlines a device, publishing a device node in the DDK.
Defined at line 287 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc
TRBPromise AddressDeviceCommand (uint8_t slot_id, uint8_t port_id, std::optional<HubInfo> hub_info, bool bsr)
Defined at line 233 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc
TRBPromise AddressDeviceCommand (uint8_t slot_id, uint8_t port_id)
Defined at line 193 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc
TRBPromise SetMaxPacketSizeCommand (uint8_t slot_id, uint8_t bMaxPacketSize0)
Defined at line 262 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc
std::optional<usb_speed_t> GetDeviceSpeed (uint8_t slot_id)
Defined at line 209 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc
usb_speed_t GetPortSpeed (uint8_t port_id)
Defined at line 228 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc
void SetDeviceInformation (uint8_t slot, uint8_t port, const std::optional<HubInfo> & hub)
Defined at line 244 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc
fpromise::promise<void, zx_status_t> Timeout (uint16_t target_interrupter, zx::time deadline)
Creates a promise that resolves after a timeout
Defined at line 290 of file ../../src/devices/usb/drivers/xhci/tests/xhci-event-ring-test.cc
void RunUntilIdle ()
Provides a barrier for promises.
After this method is invoked, all pending promises on all interrupters will be flushed.
Defined at line 291 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
void RunUntilIdle (uint16_t target_interrupter)
Provides a barrier for promises.
After this method is invoked, all pending promises on the target interrupter will be flushed.
Defined at line 301 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
Interrupter & interrupter (uint16_t i)
interrupter(uint32_t i): returns the interrupter with the corresponding index
Defined at line 306 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
const zx::bti & bti ()
Defined at line 311 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
size_t GetPageSize ()
Defined at line 313 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
bool Is32BitController ()
Defined at line 315 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
template <class T>
T * GetTestHarness ()
Retrieves the current test harness
Defined at line 322 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
dma_buffer::BufferFactory & buffer_factory ()
Defined at line 326 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
inspect::Node & inspect_root_node ()
Defined at line 328 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
fidl::ClientEnd<fuchsia_power_system::ActivityGovernor> & activity_governer ()
Defined at line 332 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h
fpromise::promise<void, zx_status_t> UsbHciEnableEndpoint (uint32_t device_id, const usb_endpoint_descriptor_t * ep_desc, const usb_ss_ep_comp_descriptor_t * ss_com_desc)
Defined at line 717 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc
fpromise::promise<void, zx_status_t> UsbHciDisableEndpoint (uint32_t device_id, const usb_endpoint_descriptor_t * ep_desc, const usb_ss_ep_comp_descriptor_t * ss_com_desc)
Defined at line 828 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc
void CreateDeviceInspectNode (uint32_t slot, uint16_t vendor_id, uint16_t product_id)
Defined at line 385 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc
void ResetPort (uint16_t port)
Resets a port. Not to be confused with ResetDevice.
Defined at line 398 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc
TRBPromise SubmitCommand (const TRB & command, std::unique_ptr<TRBContext> trb_context)
Asynchronously submits a command to the command queue.
Defined at line 1668 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc