Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
phy.h File Reference

Public APIs for Ethernet PHY drivers. More...

#include <zephyr/types.h>
#include <zephyr/device.h>

Go to the source code of this file.

Data Structures

struct  phy_link_state
 Link state. More...
 
struct  phy_plca_cfg
 PLCA (Physical Layer Collision Avoidance) Reconciliation Sublayer configurations. More...
 

Macros

#define PHY_LINK_IS_FULL_DUPLEX(x)
 Check if phy link is full duplex.
 
#define PHY_LINK_IS_SPEED_1000M(x)
 Check if phy link speed is 1 Gbit/sec.
 
#define PHY_LINK_IS_SPEED_100M(x)
 Check if phy link speed is 100 Mbit/sec.
 

Typedefs

typedef void(* phy_callback_t) (const struct device *dev, struct phy_link_state *state, void *user_data)
 Define the callback function signature for phy_link_callback_set() function.
 

Enumerations

enum  phy_link_speed {
  LINK_HALF_10BASE_T = BIT(0) , LINK_FULL_10BASE_T = BIT(1) , LINK_HALF_100BASE_T = BIT(2) , LINK_FULL_100BASE_T = BIT(3) ,
  LINK_HALF_1000BASE_T = BIT(4) , LINK_FULL_1000BASE_T = BIT(5) , LINK_FULL_2500BASE_T = BIT(6) , LINK_FULL_5000BASE_T = BIT(7)
}
 Ethernet link speeds. More...
 

Functions

int genphy_get_plca_cfg (const struct device *dev, struct phy_plca_cfg *plca_cfg)
 Write PHY PLCA configuration.
 
int genphy_set_plca_cfg (const struct device *dev, struct phy_plca_cfg *plca_cfg)
 Read PHY PLCA configuration.
 
int genphy_get_plca_sts (const struct device *dev, bool *plca_status)
 Read PHY PLCA status.
 
static int phy_configure_link (const struct device *dev, enum phy_link_speed speeds)
 Configure PHY link.
 
static int phy_get_link_state (const struct device *dev, struct phy_link_state *state)
 Get PHY link state.
 
static int phy_link_callback_set (const struct device *dev, phy_callback_t callback, void *user_data)
 Set link state change callback.
 
static int phy_read (const struct device *dev, uint16_t reg_addr, uint32_t *value)
 Read PHY registers.
 
static int phy_write (const struct device *dev, uint16_t reg_addr, uint32_t value)
 Write PHY register.
 
static int phy_read_c45 (const struct device *dev, uint8_t devad, uint16_t regad, uint16_t *data)
 Read PHY C45 register.
 
static int phy_write_c45 (const struct device *dev, uint8_t devad, uint16_t regad, uint16_t data)
 Write PHY C45 register.
 
static int phy_set_plca_cfg (const struct device *dev, struct phy_plca_cfg *plca_cfg)
 Write PHY PLCA configuration.
 
static int phy_get_plca_cfg (const struct device *dev, struct phy_plca_cfg *plca_cfg)
 Read PHY PLCA configuration.
 
static int phy_get_plca_sts (const struct device *dev, bool *plca_status)
 Read PHY PLCA status.
 

Detailed Description

Public APIs for Ethernet PHY drivers.