PDK API Guide for J721E
EnetPhy_Mdio Struct Reference

Detailed Description

MDIO driver.

Data Fields

int32_t(* isAlive )(uint32_t phyAddr, bool *isAlive, void *arg)
 Check if PHY is alive. More...
 
int32_t(* isLinked )(uint32_t phyAddr, bool *isLinked, void *arg)
 Check if PHY is linked. More...
 
int32_t(* readC22 )(uint32_t group, uint8_t phyAddr, uint32_t reg, uint16_t *val, void *arg)
 Read PHY register using Clause-22 frame. More...
 
int32_t(* writeC22 )(uint32_t group, uint8_t phyAddr, uint32_t reg, uint16_t val, void *arg)
 Write PHY register using Clause-22 frame. More...
 
int32_t(* readC45 )(uint32_t group, uint8_t phyAddr, uint8_t mmd, uint16_t reg, uint16_t *val, void *arg)
 Read PHY register using Clause-45 frame. More...
 
int32_t(* writeC45 )(uint32_t group, uint8_t phyAddr, uint8_t mmd, uint16_t reg, uint16_t val, void *arg)
 Write PHY register using Clause-45 frame. More...
 

Field Documentation

◆ isAlive

int32_t(* EnetPhy_Mdio::isAlive) (uint32_t phyAddr, bool *isAlive, void *arg)

Check if PHY is alive.

Checks if PHY is alive, either using an explicit register read or any other mechanism supported by the MDIO peripheral (i.e. background BMSR reads).

Parameters
phyAddrPHY device address
isAliveWhether PHY is alive or not
argsCaller's arguments passed to the PHY driver at open time
Returns
EnetPhy_ErrorCodes

◆ isLinked

int32_t(* EnetPhy_Mdio::isLinked) (uint32_t phyAddr, bool *isLinked, void *arg)

Check if PHY is linked.

Checks if PHY is linked, either using an explicit register read or any other mechanism supported by the MDIO peripheral.

Parameters
phyAddrPHY device address
isLinkedWhether PHY is linked or not
argsCaller's arguments passed to the PHY driver at open time
Returns
EnetPhy_ErrorCodes

◆ readC22

int32_t(* EnetPhy_Mdio::readC22) (uint32_t group, uint8_t phyAddr, uint32_t reg, uint16_t *val, void *arg)

Read PHY register using Clause-22 frame.

Reads a PHY register using a Clause-22 frame.

Parameters
groupUser group (use 0 if single group is supported)
phyAddrPHY device address
regRegister address
valValue read from register
argsCaller's arguments passed to the PHY driver at open time
Returns
EnetPhy_ErrorCodes

◆ writeC22

int32_t(* EnetPhy_Mdio::writeC22) (uint32_t group, uint8_t phyAddr, uint32_t reg, uint16_t val, void *arg)

Write PHY register using Clause-22 frame.

Writes a PHY register using a Clause-22 frame.

Parameters
groupUser group (use 0 if single group is supported)
phyAddrPHY device address
regRegister address
valValue to be written
argsCaller's arguments passed to the PHY driver at open time
Returns
EnetPhy_ErrorCodes

◆ readC45

int32_t(* EnetPhy_Mdio::readC45) (uint32_t group, uint8_t phyAddr, uint8_t mmd, uint16_t reg, uint16_t *val, void *arg)

Read PHY register using Clause-45 frame.

Reads a PHY register using a Clause-45 frame. Returns ENETPHY_ENOTSUPPORTED if MDIO doesn't support Clause-45 frames.

Parameters
groupUser group (use 0 if single group is supported)
phyAddrPHY device address
regRegister address
valValue read from register
argsCaller's arguments passed to the PHY driver at open time
Returns
EnetPhy_ErrorCodes

◆ writeC45

int32_t(* EnetPhy_Mdio::writeC45) (uint32_t group, uint8_t phyAddr, uint8_t mmd, uint16_t reg, uint16_t val, void *arg)

Write PHY register using Clause-45 frame.

Writes a PHY register using a Clause-45 frame. Returns ENETPHY_ENOTSUPPORTED if MDIO doesn't support Clause-45 frames.

Parameters
groupUser group (use 0 if single group is supported)
phyAddrPHY device address
regRegister address
valValue to be written
argsCaller's arguments passed to the PHY driver at open time
Returns
EnetPhy_ErrorCodes