Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

NetDev_IO_Ctrl()

A device’s input/output control/IO_Ctrl() function is used to implement miscellaneous functionality such as setting and getting the PHY link state, as well as updating the MAC link state registers when the PHY link state has changed. An optional void pointer to a data variable is passed into the function and may be used to get device parameters from the caller, or to return device parameters to the caller.

...

Every device driver’s net_dev.c

Prototype

 

...


Code Block


          static void NetDev_IO_Ctrl (NET_IF     *pif,
                                      CPU_INT08U  opt,
                                      void       *p_data,
                                      NET_ERR    *perr);

Note that since every device driver’s IO_Ctrl() function is accessed only by function pointer via the device driver’s API structure, it doesn’t need to be globally available and should therefore be declared as ‘static’.

...

NET_DEV_LINK_STATE_GET_INFO
NET_DEV_LINK_STATE_UPDATE 

The NET_DEV_LINK_STATE_GET_INFO option expects p_data to point to a variable of type NET_DEV_LINK_ETHER for the case of an Ethernet driver. This variable has two fields, Spd and Duplex, which are filled in by the PHY device driver via a call through the PHY API. µC/TCP-IP internally uses this option code in order to periodically poll the PHYs for link state.

...