class TransferRing
Defined at line 33 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.h
Used for queueing transfers to the XHCI controller
Public Methods
TRBPromise AddressDeviceCommand (uint8_t slot_id, uint8_t port_id, std::optional<HubInfo> hub_info, bool bsr)
void TransferRing ()
Defined at line 40 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.h
bool IsIsochronous ()
Defined at line 41 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.h
void SetIsochronous ()
Defined at line 42 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.h
void set_stall (bool stalled)
Defined at line 77 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.h
bool stalled ()
Defined at line 81 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.h
bool active ()
Defined at line 99 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.h
std::unique_ptr<TRBContext> AllocateContext ()
Defined at line 117 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.h
zx_status_t AddTRB (const TRB & trb, std::unique_ptr<TRBContext> context)
Defined at line 170 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
zx_status_t AssignContext (TRB * trb, std::unique_ptr<TRBContext> context, TRB * first_trb, TRB * setup_trb)
Assign a TRBContext to trb, and record that first_trb is the first TRB in the TD. trb should be
the last TRB in the TD. setup_trb is only used for control transfers.
Defined at line 239 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
zx_status_t HandleShortPacket (TRB * short_trb, size_t short_length, TRB ** last_trb)
Handles a short packet. This will walk the TRBs corresponding to the next pending TD. If it
finds short_trb it will set short_transfer_len to the total transfer length which is equal to
the length up each TRB up to and include short_trb minus short_length. Note that short_length
is the residual number of bytes not transferred, as provided by a transfer event length field.
last_trb is set to the TRB which corresponds to the TRBContext which was modified (i.e. the
last TRB in the TD). Returns ZX_ERR_IO if the TRB is misaligned, or if short_trb isn't found.
Defined at line 201 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
zx_status_t AllocateTRB (TRB ** trb, State * state)
Allocates a TRB but does not configure it.
It is the caller's responsibility to fully configure the returned TRB.
The caller may optionally rollback a transaction by calling Restore
The Cycle bit will be passed via the status field of the TRB.
The caller should store the Cycle bit locally and zero the status field
prior to doing anything else with the TRB.
Defined at line 403 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
zx::result<ContiguousTRBInfo> AllocateContiguous (size_t count)
Allocates physically contiguous TRBs.
count is the number of TRBs to allocate (not the number of bytes)
NOP TRBs will be allocated with interrupt on complete set to 0 in order to pad the allocation
if not enough contiguous TRBs are available on the current page. If a contiguous allocation is
possible without the Transfer Ring spanning a page boundary, nullptr will be returned in the
nop field of the returned ContiguousTRBInfo. The pointer to the NOP TRBs will be returned in
the nop field of the returned ContiguousTRBInfo. The caller is responsible for setting the
Cycle bit to the correct value during the transaction commit stage. The pointer to the
contiguous TRB range will be returned in the trb field of the returned ContiguousTRBInfo.
Defined at line 430 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
State SaveState ()
Defined at line 256 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
State SaveStateLocked ()
Defined at line 260 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
void CommitLocked ()
Defined at line 138 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
void Commit ()
Commits the current page.
Defined at line 131 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
void CommitTransaction (const State & start)
Commits a multi-TRB transaction
Defined at line 144 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
void Restore (const State & state)
Defined at line 266 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
void RestoreLocked (const State & state)
Defined at line 270 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
zx_status_t Init (size_t page_size, const zx::bti & bti, EventRing * ring, bool is_32bit, fdf::MmioBuffer * mmio, UsbXhci * hci)
Defined at line 275 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
zx_status_t DeinitIfActive ()
Assumption: This function must ONLY be called from the interrupt
thread. Otherwise thread-safety assumptions are violated.
Defined at line 294 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
zx_status_t Deinit ()
Defined at line 300 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
CRCR phys (uint8_t cap_length)
Only called during initialization when no other threads are running.
Would be pointless to hold the mutex here.
Defined at line 316 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
zx::result<CRCR> PeekCommandRingControlRegister (uint8_t cap_length)
Retrieves command ring control register value of the next TRB that would be returned
by AllocateTRB.
Defined at line 324 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
zx_paddr_t VirtToPhys (TRB * trb)
Defined at line 337 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
zx_paddr_t VirtToPhysLocked (TRB * trb)
Defined at line 341 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
TRB * PhysToVirt (zx_paddr_t paddr)
Defined at line 347 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
TRB * PhysToVirtLocked (zx_paddr_t paddr)
Defined at line 351 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
zx_status_t CompleteTRB (TRB * trb, std::unique_ptr<TRBContext> * context)
Defined at line 365 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
fbl::DoublyLinkedList<std::unique_ptr<TRBContext>> TakePendingTRBs ()
Defined at line 385 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc
fbl::DoublyLinkedList<std::unique_ptr<TRBContext>> TakePendingTRBsUntil (TRB * end)
Defined at line 389 of file ../../src/devices/usb/drivers/xhci/xhci-transfer-ring.cc