MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / __genphy_set_adv

Function __genphy_set_adv

components/drivers/phy/general.c:17–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15#include <rtdbg.h>
16
17static int __genphy_set_adv(int adv,int advertise)
18{
19 adv &= ~(RT_ADVERTISE_ALL | RT_ADVERTISE_100BASE4 | RT_ADVERTISE_PAUSE_CAP |
20 RT_ADVERTISE_PAUSE_ASYM);
21 if (advertise & RT_ADVERTISED__10baseT_Half)
22 adv |= RT_ADVERTISE_10HALF;
23 if (advertise & RT_ADVERTISED__10baseT_Full)
24 adv |= RT_ADVERTISE_10FULL;
25 if (advertise & RT_ADVERTISED__100baseT_Half)
26 adv |= RT_ADVERTISE_100HALF;
27 if (advertise & RT_ADVERTISED__100baseT_Full)
28 adv |= RT_ADVERTISE_100FULL;
29 if (advertise & RT_ADVERTISED__Pause)
30 adv |= RT_ADVERTISE_PAUSE_CAP;
31 if (advertise & RT_ADVERTISED__Asym_Pause)
32 adv |= RT_ADVERTISE_PAUSE_ASYM;
33 if (advertise & RT_ADVERTISED__1000baseX_Half)
34 adv |= RT_ADVERTISE_1000XHALF;
35 if (advertise & RT_ADVERTISED__1000baseX_Full)
36 adv |= RT_ADVERTISE_1000XFULL;
37
38 return adv;
39}
40static int __genphy_config_advert(struct rt_phy_device *phydev)
41{
42 rt_uint32_t advertise;

Callers 1

__genphy_config_advertFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected