Trait kernel::net::phy::Driver

source ·
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§

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_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 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.

Implementors§

This documentation is an old archive. Please see https://rust.docs.kernel.org instead.