lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] bind with link down


From: Massimiliano Cialdi
Subject: Re: [lwip-users] bind with link down
Date: Thu, 2 Apr 2020 23:17:36 +0200

On Thu, Apr 2, 2020 at 8:33 PM address@hidden <address@hidden> wrote:
> "Admin state" is "netif_set_up()".
>
> > How should the admin state be affected by the link state?
> Not at all. Just call "netif_set_link_up()" or down when you found out a
> state change. Leave "netif_set_up()" as it is.
what's the linux equivalent of 'admin state'? Which command could be
used to change it? This might help me figure out what admin state is
and what admin state is for.
I only know
ip link set <if> up/down
This should be the equivalent of netif_set_link_up()/netif_set_link_down()

After which events should I call netif_set_up()/netif_set_down()?

I copied this pattern from the examples found in the ST SDKs (hoping
they'd know more about it than I do.):
https://github.com/STMicroelectronics/STM32CubeF7/blob/master/Projects/STM32756G_EVAL/Applications/LwIP/LwIP_UDPTCP_Echo_Server_Netconn_RTOS

where I find comments that contradict what you're telling me
(https://github.com/STMicroelectronics/STM32CubeF7/blob/master/Projects/STM32756G_EVAL/Applications/LwIP/LwIP_UDPTCP_Echo_Server_Netconn_RTOS/Src/app_ethernet.c#L153):
/* When the netif link is down this function must be called.*/
netif_set_down(netif);

and also the call netif_set_up() in the link_callback when the link is up:
https://github.com/STMicroelectronics/STM32CubeF7/blob/master/Projects/STM32756G_EVAL/Applications/LwIP/LwIP_UDPTCP_Echo_Server_Netconn_RTOS/Src/app_ethernet.c#L144


best regards
Max

-- 
Et nunc, auxilium solis, vincam!
Oppugnatio solaris!
VIS!

Massimiliano Cialdi
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]