Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Driver Operations Ethernet PHY driver operations More...

#include <zephyr/net/phy.h>

Data Fields

int(* get_link )(const struct device *dev, struct phy_link_state *state)
  OPT Get PHY link state.
int(* cfg_link )(const struct device *dev, enum phy_link_speed adv_speeds, enum phy_cfg_link_flag flags)
  OPT Configure PHY link.
int(* link_cb_set )(const struct device *dev, phy_callback_t cb, void *user_data)
  OPT Set link state change callback.
int(* read )(const struct device *dev, uint16_t reg_addr, uint32_t *data)
  OPT Read PHY registers.
int(* write )(const struct device *dev, uint16_t reg_addr, uint32_t data)
  OPT Write PHY register.
int(* read_c45 )(const struct device *dev, uint8_t devad, uint16_t regad, uint16_t *data)
  OPT Read PHY C45 register.
int(* write_c45 )(const struct device *dev, uint8_t devad, uint16_t regad, uint16_t data)
  OPT Write PHY C45 register.
int(* set_plca_cfg )(const struct device *dev, struct phy_plca_cfg *plca_cfg)
  OPT Write PHY PLCA configuration.
int(* get_plca_cfg )(const struct device *dev, struct phy_plca_cfg *plca_cfg)
  OPT Read PHY PLCA configuration.
int(* get_plca_sts )(const struct device *dev, bool *plca_sts)
  OPT Read PHY PLCA status.

Detailed Description

Driver Operations Ethernet PHY driver operations

This is the driver API structure any Ethernet PHY driver needs to define. It contains function pointers to the operations the driver implements, as well as any other driver-specific constant data.

Members marked with REQ MUST be set by the driver, whereas those marked with OPT are optional.

See also
DEVICE_DT_INST_DEFINE()
DEVICE_DT_DEFINE()
DEVICE_API()

Field Documentation

◆ cfg_link

int(* ethphy_driver_api::cfg_link) (const struct device *dev, enum phy_link_speed adv_speeds, enum phy_cfg_link_flag flags)

OPT Configure PHY link.

◆ get_link

int(* ethphy_driver_api::get_link) (const struct device *dev, struct phy_link_state *state)

OPT Get PHY link state.

◆ get_plca_cfg

int(* ethphy_driver_api::get_plca_cfg) (const struct device *dev, struct phy_plca_cfg *plca_cfg)

OPT Read PHY PLCA configuration.

Attention
Available only when the following Kconfig option is enabled: CONFIG_ETH_PHY_API_PLCA.

◆ get_plca_sts

int(* ethphy_driver_api::get_plca_sts) (const struct device *dev, bool *plca_sts)

OPT Read PHY PLCA status.

Attention
Available only when the following Kconfig option is enabled: CONFIG_ETH_PHY_API_PLCA.

◆ link_cb_set

int(* ethphy_driver_api::link_cb_set) (const struct device *dev, phy_callback_t cb, void *user_data)

OPT Set link state change callback.

Important
Drivers must invoke the callback once after setting it, even if link state has not changed.

◆ read

int(* ethphy_driver_api::read) (const struct device *dev, uint16_t reg_addr, uint32_t *data)

OPT Read PHY registers.

◆ read_c45

int(* ethphy_driver_api::read_c45) (const struct device *dev, uint8_t devad, uint16_t regad, uint16_t *data)

OPT Read PHY C45 register.

◆ set_plca_cfg

int(* ethphy_driver_api::set_plca_cfg) (const struct device *dev, struct phy_plca_cfg *plca_cfg)

OPT Write PHY PLCA configuration.

Attention
Available only when the following Kconfig option is enabled: CONFIG_ETH_PHY_API_PLCA.

◆ write

int(* ethphy_driver_api::write) (const struct device *dev, uint16_t reg_addr, uint32_t data)

OPT Write PHY register.

◆ write_c45

int(* ethphy_driver_api::write_c45) (const struct device *dev, uint8_t devad, uint16_t regad, uint16_t data)

OPT Write PHY C45 register.


The documentation for this struct was generated from the following file: