lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: Detailed description of modifications LwIP 1.3.x -> LwI


From: Matt Dittrich
Subject: [lwip-users] Re: Detailed description of modifications LwIP 1.3.x -> LwIP 1.4.x
Date: Thu, 13 Jan 2011 07:26:58 -0800 (PST)

I updated to 1.4.0 CVS in late June of 2010, so some things might have changed 
(don't think I have updated since...), but here are some of my notes from then:

1. in your ethernetif.c, change all "struct ip_addr" to "ip_addr_t"
2. add (OR in) NETIF_FLAG_ETHARP to netif->flags in low_level_init()
3. changed netif_add() to use ethernet_input() instead of ip_input() for the 
"netif_input_fn input" parameter.
4. my port has a "handlepackets()" type function that runs low_level_input(), I 
pass the result of low_level_input() to netif->input().  For 1.3, I would send 
it to either etharp_ip_input() or etharp_arp_input() conditional upon 
ethhdr->type, now I just ensure it is either ETHTYPE_IP or ETHTYPE_ARP before 
passing it on and pbuf_free()'ing it.
5. I chose to drop my custom timer implementation for lwIP's built in one.  
This entailed creating a "sys_arch.c", define sys_init() and sys_now() (removed 
clock.c/h, which defined clock()).  add MEMP_NUM_SYS_TIMEOUT to lwipopts.h, 
ensure NO_SYS_NO_TIMERS is also correct.  I added a call to 
sys_check_timeouts() in my loop.

Some makefile changes:
build sys_arch.c instead of clock.c
add new /lwip/core/def.c to build
add new /lwip/core/timers.c to build

I apologize if any of this is (too) port specific... I run NO_SYS=1 in a 
FreeRTOS thread polling the MAC in low_level_input(). There were also some 
other changes for DHCP/AUTO_IP that I am not certain I have 100% correct...
 

MD







reply via email to

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