pub trait Driver {
Show 15 associated constants and 11 methods
const NAME: &'static CStr;
const USE_VTABLE_ATTR: ();
const FLAGS: u32 = 0;
const PHY_DEVICE_ID: DeviceId = _;
const HAS_SOFT_RESET: bool = false;
const HAS_PROBE: bool = false;
const HAS_GET_FEATURES: bool = false;
const HAS_MATCH_PHY_DEVICE: bool = false;
const HAS_CONFIG_ANEG: bool = false;
const HAS_READ_STATUS: bool = false;
const HAS_SUSPEND: bool = false;
const HAS_RESUME: bool = false;
const HAS_READ_MMD: bool = false;
const HAS_WRITE_MMD: bool = false;
const HAS_LINK_CHANGE_NOTIFY: bool = false;
// Provided methods
fn soft_reset(_dev: &mut Device) -> Result { ... }
fn probe(_dev: &mut Device) -> Result { ... }
fn get_features(_dev: &mut Device) -> Result { ... }
fn match_phy_device(_dev: &Device) -> bool { ... }
fn config_aneg(_dev: &mut Device) -> Result { ... }
fn read_status(_dev: &mut Device) -> Result<u16> { ... }
fn suspend(_dev: &mut Device) -> Result { ... }
fn resume(_dev: &mut Device) -> Result { ... }
fn read_mmd(_dev: &mut Device, _devnum: u8, _regnum: u16) -> Result<u16> { ... }
fn write_mmd(
_dev: &mut Device,
_devnum: u8,
_regnum: u16,
_val: u16,
) -> Result { ... }
fn link_change_notify(_dev: &mut Device) { ... }
}Expand description
Driver implementation for a particular PHY type.
This trait is used to create a DriverVTable.
Required Associated Constants§
Sourceconst USE_VTABLE_ATTR: ()
const USE_VTABLE_ATTR: ()
A marker to prevent implementors from forgetting to use #[vtable]
attribute when implementing this trait.
Provided Associated Constants§
Sourceconst FLAGS: u32 = 0
const FLAGS: u32 = 0
Defines certain other features this PHY supports.
It is a combination of the flags in the flags module.
Sourceconst PHY_DEVICE_ID: DeviceId = _
const PHY_DEVICE_ID: DeviceId = _
This driver only works for PHYs with IDs which match this field. The default id and mask are zero.
Sourceconst HAS_SOFT_RESET: bool = false
const HAS_SOFT_RESET: bool = false
Indicates if the soft_reset method is overridden by the implementor.
Sourceconst HAS_GET_FEATURES: bool = false
const HAS_GET_FEATURES: bool = false
Indicates if the get_features method is overridden by the implementor.
Sourceconst HAS_MATCH_PHY_DEVICE: bool = false
const HAS_MATCH_PHY_DEVICE: bool = false
Indicates if the match_phy_device method is overridden by the implementor.
Sourceconst HAS_CONFIG_ANEG: bool = false
const HAS_CONFIG_ANEG: bool = false
Indicates if the config_aneg method is overridden by the implementor.
Sourceconst HAS_READ_STATUS: bool = false
const HAS_READ_STATUS: bool = false
Indicates if the read_status method is overridden by the implementor.
Sourceconst HAS_SUSPEND: bool = false
const HAS_SUSPEND: bool = false
Indicates if the suspend method is overridden by the implementor.
Sourceconst HAS_RESUME: bool = false
const HAS_RESUME: bool = false
Indicates if the resume method is overridden by the implementor.
Sourceconst HAS_READ_MMD: bool = false
const HAS_READ_MMD: bool = false
Indicates if the read_mmd method is overridden by the implementor.
Sourceconst HAS_WRITE_MMD: bool = false
const HAS_WRITE_MMD: bool = false
Indicates if the write_mmd method is overridden by the implementor.
Sourceconst HAS_LINK_CHANGE_NOTIFY: bool = false
const HAS_LINK_CHANGE_NOTIFY: bool = false
Indicates if the link_change_notify method is overridden by the implementor.
Provided Methods§
Sourcefn soft_reset(_dev: &mut Device) -> Result
fn soft_reset(_dev: &mut Device) -> Result
Issues a PHY software reset.
Sourcefn get_features(_dev: &mut Device) -> Result
fn get_features(_dev: &mut Device) -> Result
Probes the hardware to determine what abilities it has.
Sourcefn match_phy_device(_dev: &Device) -> bool
fn match_phy_device(_dev: &Device) -> bool
Returns true if this is a suitable driver for the given phydev.
If not implemented, matching is based on Driver::PHY_DEVICE_ID.
Sourcefn config_aneg(_dev: &mut Device) -> Result
fn config_aneg(_dev: &mut Device) -> Result
Configures the advertisement and resets auto-negotiation if auto-negotiation is enabled.
Sourcefn read_status(_dev: &mut Device) -> Result<u16>
fn read_status(_dev: &mut Device) -> Result<u16>
Determines the negotiated speed and duplex.
Sourcefn read_mmd(_dev: &mut Device, _devnum: u8, _regnum: u16) -> Result<u16>
fn read_mmd(_dev: &mut Device, _devnum: u8, _regnum: u16) -> Result<u16>
Overrides the default MMD read function for reading a MMD register.
Sourcefn write_mmd(_dev: &mut Device, _devnum: u8, _regnum: u16, _val: u16) -> Result
fn write_mmd(_dev: &mut Device, _devnum: u8, _regnum: u16, _val: u16) -> Result
Overrides the default MMD write function for writing a MMD register.
Sourcefn link_change_notify(_dev: &mut Device)
fn link_change_notify(_dev: &mut Device)
Callback for notification of link change.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".