lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #20409] Add netif callback function for link change ev


From: Frédéric Bernon
Subject: [lwip-devel] [bug #20409] Add netif callback function for link change event
Date: Tue, 10 Jul 2007 10:33:48 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4

Follow-up Comment #3, bug #20409 (project lwip):

>status_callback is a call from netif TO the driver for the netif_set_up and
*_down events. 

I think it's more "TO the application" than the driver. In my case, I use it
to log any change about IP address. Of course, we can use it like we want.

>netif_link_change_callback would be a callback FROM the driver into the
stack when it experiences link changes. 

Yes (but if you are in the driver context, don't forget to protect the core).
I think it should be an option, and not something "mandatory" if you don't
have such possibility...

>It seems better to keep any stack operations (ARP, DHCP, etc) out of the
driver and initiated by the stack in response to a driver event. As for the
context the callback should be executed... I hadnt thought that part through
:) 

If we don't talk about details, each time your "link change to up", we should
do :

- update AUTOIP/DHCP to renew or get a new IP
- send a "gratuitous ARP"

Like this, a device is more "mobile".

Last, there is no real guidelines for "driver design". Any value to return if
a driver can't send a packet is defined (because all its internal "buffers"
are full by example). That the "phy link is down" is another case. It's
something to define...





    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?20409>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/





reply via email to

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