typedef struct {
  int addr;
  unsigned short operating_mode;
  unsigned short configuration_flags;
  unsigned short mii_mode;
  unsigned short auto_negotiation;
  CTL_NET_PHY_INIT_FN_t init_fn;
  CTL_NET_PHY_UPDATE_FN_t update_fn;
  CTL_PHY_STATE_t state;
  CTL_MUTEX_t mutex;
  const char *name;

CTL_NET_PHY_DRIVER_t contains data and hardware-specific function overloads for the PHY layer. The CTL_NET_PHY_DRIVER_t structure has the following members:

The address of the PHY in use, 0 through 31. The network stack sets this member before initializing the PHY using init_fn.
The PHY-layer flags including link capability and operating mode.
The logical state of the PHY. This member must only be written by the update_fn method, to reflect the current link state.
The MAC layer should call the wrapper version of this function, ctl_phy_init, during hardware initialization, after the MII is initialized.
The network task will periodically call the wrapper version of this function, ctl_net_update_phy, to update the PHY state.
When user-level code wants access to PHY registers, this holds off the periodic functions so we can access the PHY ourselves. There is no need for direct access to this mutex as the wrapper functions ctl_net_read_phy_register and ctl_net_get_phy_state lock the mutex to prevent simultaneous access by the network task.
The device name of the PHY.
See Also

ctl_net_update_phy, ctl_net_get_phy_state, ctl_net_read_phy_operating_mode, ctl_net_read_phy_register.