lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] how to set the link up


From: Noam Weissman
Subject: Re: [lwip-users] how to set the link up
Date: Wed, 5 Jul 2017 14:40:05 +0000

Hi Sylvian,

THANKS for pointing this out !!!. 

I am using the code I sent for several years and was not aware of that :-(

The base code was taken from ST example !!

I could not find netifapi_netif_set_link_up ... did you mean 
netifapi_netif_set_up ?

BR,
Noam.

-----Original Message-----
From: lwip-users [mailto:address@hidden On Behalf Of Sylvain Rochet
Sent: Wednesday, July 05, 2017 4:35 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] how to set the link up

HI,

On Wed, Jul 05, 2017 at 03:01:49PM +0200, massimiliano cialdi wrote:
> On 05/07/2017 13:59, Noam Weissman wrote:
> >>From what I have seen the KSZ8081RNACA is an IEEE compliant PHY... that 
> >>means that the driver is standard.
> >
> >You need to read PHY_BSR register (1) and check bit 3 ... this is the link 
> >status. This is what I am doing in a task.
> >The reason for doing the above is that a PHY with RMII has no link 
> >interrupt and the simplest way is to read the basic status register.
> Yes, I know, but I wonder where, in the code, to poll that register. 
> Do I need to provide a task as you do? And netif_set_link_up() has to 
> be called only from this task?

netif_set_link_up() is not thread safe and as such *MUST* *NOT* be called 
outside the lwIP core thread. You can use
netifapi_netif_set_link_up() instead.

Anyway, this is purely optional, if you don't care how much time
DHCP/IPv6 recover from a link down condition, you can as well call
netif_set_link_up() just once in your netif init callback.

Same for administrative state, if your interface is never going to be 
administratively set down (which is the case for almost all cases unless you 
have to play with multiple interfaces and therefore may have to chose an 
outgoing path), then you only have to call netif_set_up() once in your netif 
init callback.

Sylvain

reply via email to

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