rust/kernel/net/phy.rs
Source file repositories/reference/linux-study-clean/rust/kernel/net/phy.rs
File Facts
- System
- Linux kernel
- Corpus path
rust/kernel/net/phy.rs- Extension
.rs- Size
- 32003 bytes
- Lines
- 908
- Domain
- Rust Kernel Layer
- Bucket
- Rust API Membrane
- Inferred role
- Rust Kernel Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
Rust-side wrappers and abstractions around kernel C APIs, ownership contracts, allocation, synchronization, and module integration.
- Rust-side wrappers and abstractions around kernel C APIs, ownership contracts, allocation, synchronization, and module integration.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
struct Moduleenum DeviceMaskfunction set_speedfunction set_duplexfunction to_resultfunction Okfunction soft_resetfunction Ok
Annotated Snippet
struct Module {
_reg: $crate::net::phy::Registration,
}
$crate::prelude::module! {
type: Module,
$($f)*
}
const _: () = {
static mut DRIVERS: [$crate::net::phy::DriverVTable;
$crate::module_phy_driver!(@count_devices $($driver),+)] =
[$($crate::net::phy::create_phy_driver::<$driver>()),+];
impl $crate::Module for Module {
fn init(module: &'static $crate::ThisModule) -> Result<Self> {
// SAFETY: The anonymous constant guarantees that nobody else can access
// the `DRIVERS` static. The array is used only in the C side.
let drivers = unsafe { &mut DRIVERS };
let mut reg = $crate::net::phy::Registration::register(
module,
::core::pin::Pin::static_mut(drivers),
)?;
Ok(Module { _reg: reg })
}
}
};
$crate::module_phy_driver!(@device_table [$($dev),+]);
}
}
Annotation
- Detected declarations: `struct Module`, `enum DeviceMask`, `function set_speed`, `function set_duplex`, `function to_result`, `function Ok`, `function soft_reset`, `function Ok`.
- Atlas domain: Rust Kernel Layer / Rust API Membrane.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.