Versions Compared

Key

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

...

Anchor11154901115490 NetPhy_LinkStateSet() Anchor11154911115491The Ethernet PHY’s 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. Anchor11154921115492

Files

...

Every physical layer driver’s net_phy.c Anchor11155011115501

Prototype

...

static void NetPhy_LinkStateSet (NET_IF *pif, NET_ERR *perr);
HTML Table
summary
classCode_Listing
Table Row (tr)
Table Cell (td)
rowspan2
Anchor
11154961115496
Anchor
11359871135987
Code Block

          static void NetPhy_LinkStateSet (NET_IF             *pif,
                                           NET_DEV_LINK_ETHER *plink_state,
Anchor
11359881135988
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’. Anchor11155031115503 Arguments Anchor11158421115842 pif Anchor11322211132221static’.

Arguments

pif

Pointer to the interface to set a PHY’s current link state.

...

plink_state Anchor11322231132223

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

...

  Anchor11155061115506perr Anchor11322631132263

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

...

Returned Value

...

None. Anchor11155111115511

Required Configuration

...

None. Anchor11155131115513

Notes/Warnings

...

None.