Trait Driver

Source
pub trait Driver {
Show 15 associated constants and 11 methods const USE_VTABLE_ATTR: (); const NAME: &'static CStr; 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; const FLAGS: u32 = 0u32; const PHY_DEVICE_ID: DeviceId = _; // 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§

Source

const USE_VTABLE_ATTR: ()

A marker to prevent implementors from forgetting to use #[vtable] attribute when implementing this trait.

Source

const NAME: &'static CStr

The friendly name of this PHY type.

Provided Associated Constants§

Source

const HAS_SOFT_RESET: bool = false

Indicates if the soft_reset method is overridden by the implementor.

Source

const HAS_PROBE: bool = false

Indicates if the probe method is overridden by the implementor.

Source

const HAS_GET_FEATURES: bool = false

Indicates if the get_features method is overridden by the implementor.

Source

const HAS_MATCH_PHY_DEVICE: bool = false

Indicates if the match_phy_device method is overridden by the implementor.

Source

const HAS_CONFIG_ANEG: bool = false

Indicates if the config_aneg method is overridden by the implementor.

Source

const HAS_READ_STATUS: bool = false

Indicates if the read_status method is overridden by the implementor.

Source

const HAS_SUSPEND: bool = false

Indicates if the suspend method is overridden by the implementor.

Source

const HAS_RESUME: bool = false

Indicates if the resume method is overridden by the implementor.

Source

const HAS_READ_MMD: bool = false

Indicates if the read_mmd method is overridden by the implementor.

Source

const HAS_WRITE_MMD: bool = false

Indicates if the write_mmd method is overridden by the implementor.

Indicates if the link_change_notify method is overridden by the implementor.

Source

const FLAGS: u32 = 0u32

Defines certain other features this PHY supports. It is a combination of the flags in the flags module.

Source

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§

Source

fn soft_reset(_dev: &mut Device) -> Result

Issues a PHY software reset.

Source

fn probe(_dev: &mut Device) -> Result

Sets up device-specific structures during discovery.

Source

fn get_features(_dev: &mut Device) -> Result

Probes the hardware to determine what abilities it has.

Source

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.

Source

fn config_aneg(_dev: &mut Device) -> Result

Configures the advertisement and resets auto-negotiation if auto-negotiation is enabled.

Source

fn read_status(_dev: &mut Device) -> Result<u16>

Determines the negotiated speed and duplex.

Source

fn suspend(_dev: &mut Device) -> Result

Suspends the hardware, saving state if needed.

Source

fn resume(_dev: &mut Device) -> Result

Resumes the hardware, restoring state if needed.

Source

fn read_mmd(_dev: &mut Device, _devnum: u8, _regnum: u16) -> Result<u16>

Overrides the default MMD read function for reading a MMD register.

Source

fn write_mmd(_dev: &mut Device, _devnum: u8, _regnum: u16, _val: u16) -> Result

Overrides the default MMD write function for writing a MMD register.

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", so this trait is not object safe.

Implementors§