Versions Compared

Key

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

NetDev_MII_Wr()

Next is the (R)MII write/Phy_RegWr() function. This function is generally implemented within the Ethernet device driver file since (R)MII bus writes are generally associated with the MAC device. In the case that the PHY communication mechanism is separate from the MAC, a handler function may be provided within the net_bsp.c file and called from the device driver file instead.

...

Every device driver’s net_dev.c

Prototype

 

...


Code Block
          static void NetDev_MII_Wr (NET_IF     *pif,
                                     CPU_INT08U  phy_addr,
                                     CPU_INT08U  reg_addr,
                                     CPU_INT16U  data,
                                     NET_ERR    *perr);

Note that since every device driver’s Phy_RegWr()/MII_Wr() 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’.

...