pub trait Driver {
Show 14 associated constants and 10 methods
const USE_VTABLE_ATTR: ();
const NAME: &'static CStr;
const HAS_SOFT_RESET: 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;
const FLAGS: u32 = 0u32;
const PHY_DEVICE_ID: DeviceId = _;
// Provided methods
fn soft_reset(_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 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.
sourceconst FLAGS: u32 = 0u32
const FLAGS: u32 = 0u32
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.
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.