redox-driver-core: add PciErsResult — Linux pci_ers_result 6-state enum
Mirrors Linux 7.1's pci_ers_result (include/linux/pci.h:920-938): None/CanRecover/NeedReset/Disconnect/Recovered/NoAerDriver. This is the vocabulary Driver::error_detected will return when the AER recovery flow is wired to bound drivers. Currently the legacy RecoveryAction enum (Handled/ResetDevice/RescanBus/Fatal) coexists for the existing on_error callback — PciErsResult is the richer model that will replace it once the driver-manager → driver IPC channel exists for AER dispatch.
This commit is contained in:
@@ -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"`.
|
||||
|
||||
Reference in New Issue
Block a user