diff --git a/local/recipes/drivers/redox-driver-core/source/src/driver.rs b/local/recipes/drivers/redox-driver-core/source/src/driver.rs index eafb5d8995..b4fff86081 100644 --- a/local/recipes/drivers/redox-driver-core/source/src/driver.rs +++ b/local/recipes/drivers/redox-driver-core/source/src/driver.rs @@ -61,6 +61,26 @@ pub enum RecoveryAction { Fatal, } +/// The 6-state PCI error-recovery result, mirroring Linux's +/// `pci_ers_result` (include/linux/pci.h:920-938). Used by +/// `Driver::error_detected` to report whether the driver can recover, +/// needs a reset, or is dead. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum PciErsResult { + /// No action taken. + None, + /// Driver can recover without a device reset. + CanRecover, + /// Driver requests a slot reset before continuing. + NeedReset, + /// Device is permanently lost; disconnect. + Disconnect, + /// Recovery completed successfully. + Recovered, + /// No AER-capable driver is bound. + NoAerDriver, +} + /// A device driver that can bind to and manage devices. pub trait Driver: Send + Sync { /// Returns the unique driver name, such as `"nvmed"` or `"e1000d"`.