class UsbXhci

Defined at line 65 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

Keeps track of events received from the XHCI controller

Public Methods

zx::result<> Start (fdf::DriverContext context)

Defined at line 23 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc

void Stop (fdf::StopCompleter completer)

Defined at line 25 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc

void ~UsbXhci ()

Defined at line 29 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 34 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 39 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 41 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 43 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc

uint64_t UsbHciGetCurrentFrame ()

Defined at line 50 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 52 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 56 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 60 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 64 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 68 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc

void UsbXhci ()

Defined at line 72 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

zx_status_t UsbHciResetDevice (uint32_t hub_address, uint32_t device_id)

Defined at line 72 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 76 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc

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

size_t UsbHciGetRequestSize ()

Defined at line 78 of file ../../src/devices/usb/drivers/xhci/tests/test-xhci.cc

void SetInterface (SetInterfaceRequest & request, SetInterfaceCompleter::Sync & completer)

Stubs for FIDL HCI

Defined at line 87 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

void GetMaxDeviceCount (GetMaxDeviceCountCompleter::Sync & completer)

Defined at line 91 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

void EnableEndpoint (EnableEndpointRequest & request, EnableEndpointCompleter::Sync & completer)

Defined at line 95 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

void GetCurrentFrame (GetCurrentFrameCompleter::Sync & completer)

Defined at line 100 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

void ConfigureHub (ConfigureHubRequest & request, ConfigureHubCompleter::Sync & completer)

Defined at line 104 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

void HubDeviceAdded (HubDeviceAddedRequest & request, HubDeviceAddedCompleter::Sync & completer)

Defined at line 108 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

void HubDeviceRemoved (HubDeviceRemovedRequest & request, HubDeviceRemovedCompleter::Sync & completer)

Defined at line 113 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

void HubDeviceReset (HubDeviceResetRequest & request, HubDeviceResetCompleter::Sync & completer)

Defined at line 118 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

void ResetEndpoint (ResetEndpointRequest & request, ResetEndpointCompleter::Sync & completer)

Defined at line 123 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

void ResetDevice (ResetDeviceRequest & request, ResetDeviceCompleter::Sync & completer)

Defined at line 128 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

void GetMaxTransferSize (GetMaxTransferSizeRequest & request, GetMaxTransferSizeCompleter::Sync & completer)

Defined at line 132 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 161 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 325 of file ../../src/devices/usb/drivers/xhci/tests/xhci-event-ring-test.cc

fpromise::promise<OwnedRequest, void> UsbHciRequestQueue (OwnedRequest usb_request)

Queues a request and returns a promise

Defined at line 185 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc

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 807 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 182 of file ../../src/devices/usb/drivers/xhci/tests/xhci-endpoint-test.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 919 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc

fpromise::promise<void, zx_status_t> UsbHciResetEndpointAsync (uint32_t device_id, uint8_t ep_address)

Defined at line 296 of file ../../src/devices/usb/drivers/xhci/tests/xhci-event-ring-test.cc

bool Running ()

UsbXhci Methods

Defined at line 262 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 321 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 292 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 396 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc

fpromise::promise<void, zx_status_t> DisableSlotCommand (uint32_t slot_id)

Disables a slot

Defined at line 127 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc

fpromise::promise<void, zx_status_t> DisableSlotCommand (DeviceState & state)

Defined at line 137 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc

TRBPromise EnableSlotCommand ()

Defined at line 178 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc

void AbortPendingCommands ()

Defined at line 27 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

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 191 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

void RingDoorbell (uint8_t slot, uint8_t target)

Defined at line 192 of file ../../src/devices/usb/drivers/xhci/tests/xhci-endpoint-test.cc

size_t slot_size_bytes ()

Defined at line 217 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

uint8_t CapLength ()

Returns the value in the CAPLENGTH register

Defined at line 220 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

uint8_t DeviceIdToSlotId (uint8_t device_id)

Defined at line 222 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

uint8_t SlotIdToDeviceId (uint8_t slot_id)

Defined at line 224 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

uint8_t GetPortCount ()

Defined at line 228 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

void WaitForBringup ()

Waits for xHCI bringup to complete

Defined at line 234 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

CommandRing * GetCommandRing ()

Defined at line 236 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

fbl::Array<fbl::RefPtr<DeviceState>> & GetDeviceState ()

Defined at line 238 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

TRBPromise AddressDeviceCommand (uint8_t slot_id, uint8_t port_id, std::optional<HubInfo> hub_info, bool bsr)

Defined at line 238 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc

TRBPromise AddressDeviceCommand (uint8_t slot_id, uint8_t port_id)

Defined at line 198 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc

PortState & GetPortState (size_t port_id)

Returns the state of a 1-based port index.

Defined at line 241 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

const PortState & GetPortState (size_t port_id)

Defined at line 245 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 251 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 256 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 259 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 262 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 267 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

TRBPromise SetMaxPacketSizeCommand (uint8_t slot_id, uint8_t bMaxPacketSize0)

Defined at line 267 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc

std::optional<usb_speed_t> GetDeviceSpeed (uint8_t slot_id)

Defined at line 214 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc

usb_speed_t GetPortSpeed (uint8_t port_id)

Defined at line 233 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 249 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc

bool IsHaltedOrStopping ()

Defined at line 271 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 279 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

void ResetPort (uint16_t port)

Resets a port. Not to be confused with ResetDevice.

Defined at line 409 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 316 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 318 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 328 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 335 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

const zx::bti & bti ()

Defined at line 340 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

size_t GetPageSize ()

Defined at line 342 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

bool Is32BitController ()

Defined at line 344 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

uint16_t irq_count ()

Defined at line 346 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

void SetRunningForTesting (bool running)

Defined at line 348 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

void SignalBringupForTesting ()

Defined at line 349 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

template <class T>
T * GetTestHarness ()

Retrieves the current test harness

Defined at line 356 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

dma_buffer::BufferFactory & buffer_factory ()

Defined at line 360 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

inspect::Node & inspect_root_node ()

Defined at line 362 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

fidl::ClientEnd<fuchsia_power_system::ActivityGovernor> & activity_governer ()

Defined at line 366 of file ../../src/devices/usb/drivers/xhci/usb-xhci.h

TRBPromise SubmitCommand (const TRB & command, std::unique_ptr<TRBContext> trb_context)

Asynchronously submits a command to the command queue.

Defined at line 1779 of file ../../src/devices/usb/drivers/xhci/usb-xhci.cc