...
Anchor
LinkStateSet()
function determines the current Ethernet link state. Results are passed back to the caller within a NET_DEV_LINK_ETHER
structure which contains fields for link speed and duplex. This function is called periodically by µC/TCP-IP.Files
...
Every physical layer driver’s net_phy.c
Anchor
Prototype
...
HTML Table | summary | |||
---|---|---|---|---|
class | Code_Listing | |||
Table Row (tr) | ||||
Table Cell (td) | ||||
| ||||
Anchor | 1115496 | 1115496 | static void NetPhy_LinkStateSet (NET_IF *pif,||
Anchor | 1135987 | 1135987 | ||
Code Block | ||||
static void NetPhy_LinkStateSet (NET_IF *pif, NET_DEV_LINK_ETHER *plink_state, Anchor | | 1135988 | 1135988 | NET_ERR *perr);|
Table Row (tr) |
...
NET_ERR *perr); |
Note that since every PHY driver’s LinkStateSet()
function is accessed only by function pointer via the PHY 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 set a PHY’s current link state.
...
plink_state
Anchor
Pointer to a link state structure with link state information to configure. The NET_DEV_LINK_ETHER
structure contains two fields for link speed and duplex. Link speed is set via plink_state->Spd
:
...
NET_PHY_SPD_10
...
...
NET_PHY_SPD_100
...
...
And link duplex is set via plink_state->Duplex
:
...
NET_PHY_DUPLEX_HALF
...
NET_PHY_DUPLEX_FULL
...
Anchor
perr
Pointer to variable that will receive the return error code from this function.
...
Returned Value
...
None. Anchor
Required Configuration
...
None. Anchor
Notes/Warnings
...
None.