Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

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.

Note: This function must be implemented with a timeout and not block indefinitely should the PHY fail to respond.

Files

Every device driver’s net_dev.c

Prototype

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’.

Arguments

pif

Pointer to the interface to read a (R)MII PHY register.

phy_addr

The bus address of the PHY.

reg_addr

The MII register number to write to.

p_data

Pointer to the data to write to the specified PHY register.

perr

Pointer to variable that will receive the return error code from this function.

Returned Value

None.

Required Configuration

None.

Notes/Warnings

None.

  • No labels