lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] implementing device driver: netif events handling


From: Simon Goldschmidt
Subject: Re: [lwip-users] implementing device driver: netif events handling
Date: Thu, 09 Aug 2012 08:24:23 +0200

jblackarty <address@hidden> wrote:
> 1. How to make driver to be notified when application sets it's interface
> up/down ? It's needed to remove unnecessary system load by disabling
> transmit path in hardware. There are LWIP_NETIF_STATUS_CALLBACK and
> LWIP_NETIF_LINK_CALLBACK capabilities exist but seems that they
> intended to be used by application rather then by driver.

There's currently no way to do that, as DHCP starts on a netif that is down and 
sets it to up only after getting a correct IP address.

In my opinion however, this is not optimal and it should be changed to make 
DHCP work more like on linux (i.e. start on an up interface only and make 
routing check for '0.0.0.0' IP address). We could then add a callback function 
into the netif driver to inform it of the administrative status.

> 3. Removing network interface doesn't inform driver. It causes driver
> to continue input of incoming packets with invalid netif. (However,
> resolving
> issue #1 could resolve this one too.)

This has already been implemented in git master: when 
LWIP_NETIF_REMOVE_CALLBACK==1 (default is 0), you can set a 'removed' callback 
per netif with netif_set_remove_callback().

Simon



reply via email to

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