pub enum CompletionCode {
Show 36 variants Invalid, Success, DataBufferError, BabbleDetectedError, UsbTransactionError, TrbError, StallError, ResourceError, BandwidthError, NoSlotsAvailableError, InvalidStreamTypeError, SlotNotEnabledError, EndpointNotEnabledError, ShortPacket, RingUnderrun, RingOverrun, VfEventRingFullError, ParameterError, BandwidthOverrunError, ContextStateError, NoPingResponseError, EventRingFullError, IncompatibleDeviceError, MissedServiceError, CommandRingStopped, CommandAborted, Stopped, StoppedLengthInvalid, StoppedShortPacket, MaxExitLatencyTooLargeError, IsochBufferOverrun, EventLostError, UndefinedError, InvalidStreamIdError, SecondaryBandwidthError, SplitTransactionError,
}
Expand description

The TRB Completion Codes.

The description of each error is quoted from eXtensible Host Controller Interface for Universal Serial Bus (xHCI) Requirements Specification May 2019 Revision 1.2, Section 6.4.5, Table 6-90. Refer to this specification for more detail.

Variants§

§

Invalid

Indicates that the Completion Code field has not been updated by the TRB producer.

§

Success

Indicates successful completion of the TRB operation.

§

DataBufferError

Indicates that the Host Controller is unable to keep up the reception of incoming data (overrun) or is unable to supply data fast enough during transmission (underrun).

§

BabbleDetectedError

Asserted when “babbling” is detected during the transaction generated by this TRB.

§

UsbTransactionError

Asserted in the case where the host did not receive a valid response from the device.

§

TrbError

Asserted when a TRB parameter error condition is detected in a TRB.

§

StallError

Asserted when a Stall condition is detected for a TRB.

§

ResourceError

Asserted by a Configure Endpoint Command or an Address Device Command if there are not adequate xHC resources available to successfully complete the command.

§

BandwidthError

Asserted by a Configure Endpoint Command if periodic endpoints are declared and the xHC is not able to allocate the required Bandwidth.

§

NoSlotsAvailableError

Asserted if a adding one more device would result in the host controller to exceed the maximum Number of Device Slots for this implementation.

§

InvalidStreamTypeError

Asserted if an invalid Stream Context Type value is detected.

§

SlotNotEnabledError

Asserted if a command is issued to a Device Slot that is in the Disabled state.

§

EndpointNotEnabledError

Asserted if a doorbell is rung for an endpoint that is in the Disabled state.

§

ShortPacket

Asserted if the number of bytes received was less than the TD Transfer Size.

§

RingUnderrun

Asserted in a Transfer Event TRB if the Transfer Ring is empty when an enabled Isoch endpoint is scheduled to transmit data.

§

RingOverrun

Asserted in a Transfer Event TRB if the Transfer Ring is empty when an enabled Isoch endpoint is scheduled to receive data.

§

VfEventRingFullError

Asserted by a Force Event command if the target VF’s Event Ring is full.

§

ParameterError

Asserted by a command if a Context parameter is invalid.

§

BandwidthOverrunError

Asserted during an Isoch transfer if the TD exceeds the bandwidth allocated to the endpoint.

§

ContextStateError

Asserted if a command is issued to transition from an illegal context state.

§

NoPingResponseError

Asserted if the xHC was unable to complete a periodic data transfer associated within the ESIT, because it did not receive a PING_RESPONSE in time.

§

EventRingFullError

Asserted if the Event Ring is full, the xHC is unable to post an Event to the ring.

§

IncompatibleDeviceError

Asserted if the xHC detects a problem with a device that does not allow it to be successfully accessed.

§

MissedServiceError

Asserted if the xHC was unable to service a Isochronous endpoint within the Interval time.

§

CommandRingStopped

Asserted in a Command Completion Event due to a Command Stop operation.

§

CommandAborted

Asserted in a Command Completion Event of an aborted command if the command was terminated by a Command Abort (CA) operation.

§

Stopped

Asserted in a Transfer Event if the transfer was terminated by a Stop Endpoint Command.

§

StoppedLengthInvalid

Asserted in a Transfer Event if the transfer was terminated by a Stop Endpoint Command and the Transfer Event TRB Transfer Length field is invalid.

§

StoppedShortPacket

Asserted in a Transfer Event if the transfer was terminated by a Stop Endpoint Command, and the transfer was stopped after Short Packet conditions were met, but before the end of the TD was reached.

§

MaxExitLatencyTooLargeError

Asserted by the Evaluate Context Command if the proposed Max Exit Latency would not allow the periodic endpoints of the Device Slot to be scheduled.

§

IsochBufferOverrun

Asserted if the data buffer defined by an Isoch TD on an IN endpoint is less than the Max ESIT Payload in size and the device attempts to send more data than it can hold.

§

EventLostError

Asserted if the xHC internal event overrun condition.

§

UndefinedError

May be reported by an event when other error codes do not apply.

§

InvalidStreamIdError

Asserted if an invalid Stream ID is received.

§

SecondaryBandwidthError

Asserted by a Configure Endpoint Command if periodic endpoints are declared and the xHC is not able to allocate the required Bandwidth due to a Secondary Bandwidth Domain.

§

SplitTransactionError

Asserted if an error is detected on a USB2 protocol endpoint for a split transaction.

Trait Implementations§

source§

impl Clone for CompletionCode

source§

fn clone(&self) -> CompletionCode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CompletionCode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromPrimitive for CompletionCode

source§

fn from_i64(n: i64) -> Option<Self>

Converts an i64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_u64(n: u64) -> Option<Self>

Converts an u64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_isize(n: isize) -> Option<Self>

Converts an isize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_i8(n: i8) -> Option<Self>

Converts an i8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_i16(n: i16) -> Option<Self>

Converts an i16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_i32(n: i32) -> Option<Self>

Converts an i32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_i128(n: i128) -> Option<Self>

Converts an i128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
source§

fn from_usize(n: usize) -> Option<Self>

Converts a usize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_u8(n: u8) -> Option<Self>

Converts an u8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_u16(n: u16) -> Option<Self>

Converts an u16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_u32(n: u32) -> Option<Self>

Converts an u32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_u128(n: u128) -> Option<Self>

Converts an u128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
source§

fn from_f32(n: f32) -> Option<Self>

Converts a f32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_f64(n: f64) -> Option<Self>

Converts a f64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
source§

impl Hash for CompletionCode

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for CompletionCode

source§

fn cmp(&self, other: &CompletionCode) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<CompletionCode> for CompletionCode

source§

fn eq(&self, other: &CompletionCode) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<CompletionCode> for CompletionCode

source§

fn partial_cmp(&self, other: &CompletionCode) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for CompletionCode

source§

impl Eq for CompletionCode

source§

impl StructuralEq for CompletionCode

source§

impl StructuralPartialEq for CompletionCode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.