...
Anchor
Phy_RegRd()
function. This function is generally implemented within the Ethernet device driver file, since (R)MII bus reads are generally associated with the MAC device. In the case that the PHY communication mechanism is separate from the MAC, then 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 should not block indefinitely should the PHY fail to respond. 1110807 Anchor
Files
...
Every device driver’s net_dev.c
Anchor
Prototype
...
...
HTML Table | summary | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
class | Code_Listing | ||||||||||||
Table Row (tr) | |||||||||||||
Table Cell (td) | |||||||||||||
| |||||||||||||
Anchor | 1097363 | 1097363 | static void|||||||||||
Code Block | |||||||||||||
static void NetDev_MII_Rd (NET_IF*pif, Anchor | | 1135969 | 1135969 | CPU_INT08U phy_addr,||||||||||
Anchor | 1135970 | 1135970 | CPU_INT08U reg_addr,|||||||||||
Anchor | 1135971 | 1135971 | CPU_INT16U *p_data,|||||||||||
Anchor | 1135972 | 1135972 | NET_ERR *perr);|||||||||||
Table Row (tr) |
...
*pif,
CPU_INT08U phy_addr,
CPU_INT08U reg_addr,
CPU_INT16U *p_data,
NET_ERR *perr); |
Note that since every device driver’s Phy_RegRd()/MII_Rd()
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’. Anchor
static
’.Arguments
pif
Pointer to the interface to read a (R)MII PHY register.
Anchor
phy_addr
The bus address of the PHY.
...
reg_addr
anchorThe MII register number to read.
Anchor
p_data
Pointer to a address to store the content of the PHY register being read.
...
perr
Pointer to variable that will receive the return error code from this function.
...
Returned Value
...
None. Anchor
Required Configuration
...
Notes/Warnings
...
None.