lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] lwip 1.3.2 vs 1.4.0 - usage of netif_add()?


From: address@hidden
Subject: Re: [lwip-devel] lwip 1.3.2 vs 1.4.0 - usage of netif_add()?
Date: Fri, 24 Feb 2012 15:29:40 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

address@hidden wrote:
It's the same init function that has always been required.
I don't think so. In 1.3.2 netif_add() is defined with a total of 6 parameters 
as

netif_add(struct netif *netif, struct ip_addr *ipaddr, struct ip_addr *netmask,
   struct ip_addr *gw,
   void *state,
   void (* input)(struct pbuf *p, struct netif *netif))

in 1.4.0 it uses a total of 7 parameters and is defined as

netif_add(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask,
       ip_addr_t *gw, void *state, netif_init_fn init, netif_input_fn input);

So my problem is, the sixth parameter "netif_init_fn init" is completely new 
and I'm not sure what to do with it exactly...

I don't know what sources you are looking at, but in v1.3.2, netif_add() has the same 7 parameters as it has now (or in v1.4.0): take a look at the downloadable ZIP file: http://download.savannah.gnu.org/releases/lwip/lwip-1.3.2.zip

Aside from the function pointer prototype change, the arguments of netif_add() haven't even changed since 0.7.2, so I really don't know what sources you have there.

Anyway, the init callback is called from inside netif_add() when the struct netif has been initialized. The function should be supplied by your driver and initialize the callbacks in the netif struct, as well as the hw_addr_len, etc. See src/netif/ethernetif.c for an example.

Simon



reply via email to

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