pub trait Phy {
// Required methods
fn init<M: MdioBus>(&mut self, mdio: &mut M) -> Result<(), PhyError>;
fn poll_link<M: MdioBus>(
&mut self,
mdio: &mut M,
_cx: Option<&mut Context<'_>>,
) -> LinkState;
fn address(&self) -> u8;
}Expand description
Ethernet PHY driver.
Required Methods§
Sourcefn init<M: MdioBus>(&mut self, mdio: &mut M) -> Result<(), PhyError>
fn init<M: MdioBus>(&mut self, mdio: &mut M) -> Result<(), PhyError>
One-time hardware initialization.
Should reset the PHY, configure auto-negotiation, and wait until the hardware is ready to respond to further MDIO transactions.
Sourcefn poll_link<M: MdioBus>(
&mut self,
mdio: &mut M,
_cx: Option<&mut Context<'_>>,
) -> LinkState
fn poll_link<M: MdioBus>( &mut self, mdio: &mut M, _cx: Option<&mut Context<'_>>, ) -> LinkState
Polls the current link state.
Returns LinkState with up == true once auto-negotiation is
complete and the link partner is detected. The context can be used
to wake the caller when the link state should be re-polled, if the PHY chip
supports interrupt-driven notifications.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl Phy for GenericPhy
Available on crate feature
unstable only.