Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ virtio-net = ["net", "virtio"]
## Enables the RTL8139 network driver.
rtl8139 = ["net", "pci", "volatile/derive", "endian-num"]

## Enables the ixgbe network driver for the Intel X550.
ixgbe = ["net", "pci", "volatile/derive"]

## Enables the Cadence Gigabit Ethernet MAC (GEM) network driver.
gem-net = ["net", "dep:tock-registers"]

Expand Down
8 changes: 8 additions & 0 deletions src/drivers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ pub mod error {
#[cfg(any(
feature = "virtio",
all(target_arch = "riscv64", feature = "gem-net", not(feature = "pci")),
feature = "ixgbe",
feature = "rtl8139",
))]
use thiserror::Error;

#[cfg(all(target_arch = "riscv64", feature = "gem-net", not(feature = "pci")))]
use crate::drivers::net::gem::GEMError;
#[cfg(feature = "ixgbe")]
use crate::drivers::net::ixgbe::IxgbeError;
#[cfg(feature = "rtl8139")]
use crate::drivers::net::rtl8139::RTL8139Error;
#[cfg(feature = "virtio")]
Expand All @@ -49,6 +52,7 @@ pub mod error {
#[cfg(any(
feature = "virtio",
all(target_arch = "riscv64", feature = "gem-net", not(feature = "pci")),
feature = "ixgbe",
feature = "rtl8139",
))]
#[derive(Error, Debug)]
Expand All @@ -57,6 +61,10 @@ pub mod error {
#[error("Virtio driver failed: {0:?}")]
InitVirtioDevFail(#[from] VirtioError),

#[cfg(feature = "ixgbe")]
#[error("ixgbe driver failed: {0:?}")]
InitIxgbeDevFail(#[from] IxgbeError),

#[cfg(feature = "rtl8139")]
#[error("RTL8139 driver failed: {0:?}")]
InitRTL8139DevFail(#[from] RTL8139Error),
Expand Down
Loading
Loading