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: Sylvain Rochet
Subject: Re: [lwip-users] how to set the link up
Date: Wed, 5 Jul 2017 15:34:59 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

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

Attachment: signature.asc
Description: Digital signature


reply via email to

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