opt.h, tcpip.c: New configuration option LWIP_ARP allow to disable ARP init at build time if you only use PPP or SLIP. The default is enable. Note we don't have to call etharp_init in your port's initilization sequence if you use tcpip.c, because this call is done in tcpip_init function.

This commit is contained in:
fbernon 2007-03-26 16:13:46 +00:00
parent 005e5f2f72
commit 19338d2774
3 changed files with 24 additions and 7 deletions

View File

@ -23,6 +23,12 @@ HISTORY
++ New features: ++ New features:
2007-03-26 Frédéric Bernon, Jonathan Larmour
* opt.h, tcpip.c: New configuration option LWIP_ARP allow to disable ARP init at build
time if you only use PPP or SLIP. The default is enable. Note we don't have to call
etharp_init in your port's initilization sequence if you use tcpip.c, because this call
is done in tcpip_init function.
2007-03-22 Frédéric Bernon 2007-03-22 Frédéric Bernon
* stats.h, stats.c, msg_in.c: Stats counters can be change to u32_t if necessary with the * stats.h, stats.c, msg_in.c: Stats counters can be change to u32_t if necessary with the
new option LWIP_STATS_LARGE. If you need this option, define LWIP_STATS_LARGE to 1 in new option LWIP_STATS_LARGE. If you need this option, define LWIP_STATS_LARGE to 1 in

View File

@ -93,8 +93,9 @@ ip_timer(void *data)
ip_reass_tmr(); ip_reass_tmr();
sys_timeout( IP_TMR_INTERVAL, ip_timer, NULL); sys_timeout( IP_TMR_INTERVAL, ip_timer, NULL);
} }
#endif #endif /* IP_REASSEMBLY */
#if LWIP_ARP
static void static void
arp_timer(void *arg) arp_timer(void *arg)
{ {
@ -102,6 +103,7 @@ arp_timer(void *arg)
etharp_tmr(); etharp_tmr();
sys_timeout( ARP_TMR_INTERVAL, arp_timer, NULL); sys_timeout( ARP_TMR_INTERVAL, arp_timer, NULL);
} }
#endif /* LWIP_ARP */
#if LWIP_DHCP #if LWIP_DHCP
static void static void
@ -119,7 +121,7 @@ dhcp_timer_fine(void *arg)
dhcp_fine_tmr(); dhcp_fine_tmr();
sys_timeout(DHCP_FINE_TIMER_MSECS, dhcp_timer_fine, NULL); sys_timeout(DHCP_FINE_TIMER_MSECS, dhcp_timer_fine, NULL);
} }
#endif #endif /* LWIP_DHCP */
#if ETHARP_TCPIP_ETHINPUT #if ETHARP_TCPIP_ETHINPUT
static void static void
@ -168,15 +170,17 @@ tcpip_thread(void *arg)
#if IP_REASSEMBLY #if IP_REASSEMBLY
sys_timeout( IP_TMR_INTERVAL, ip_timer, NULL); sys_timeout( IP_TMR_INTERVAL, ip_timer, NULL);
#endif #endif /* IP_REASSEMBLY */
#if LWIP_ARP
sys_timeout( ARP_TMR_INTERVAL, arp_timer, NULL); sys_timeout( ARP_TMR_INTERVAL, arp_timer, NULL);
#endif /* LWIP_ARP */
#if LWIP_DHCP #if LWIP_DHCP
sys_timeout(DHCP_COARSE_TIMER_SECS*1000, dhcp_timer_coarse, NULL); sys_timeout(DHCP_COARSE_TIMER_SECS*1000, dhcp_timer_coarse, NULL);
sys_timeout(DHCP_FINE_TIMER_MSECS, dhcp_timer_fine, NULL); sys_timeout(DHCP_FINE_TIMER_MSECS, dhcp_timer_fine, NULL);
#endif #endif /* LWIP_DHCP */
#if LWIP_IGMP #if LWIP_IGMP
igmp_init(); igmp_init();
#endif #endif /* LWIP_IGMP */
if (tcpip_init_done != NULL) { if (tcpip_init_done != NULL) {
tcpip_init_done(tcpip_init_done_arg); tcpip_init_done(tcpip_init_done_arg);
@ -302,13 +306,16 @@ tcpip_apimsg(struct api_msg *apimsg)
void void
tcpip_init(void (* initfunc)(void *), void *arg) tcpip_init(void (* initfunc)(void *), void *arg)
{ {
#if LWIP_ARP
etharp_init();
#endif /*LWIP_ARP */
ip_init(); ip_init();
#if LWIP_UDP #if LWIP_UDP
udp_init(); udp_init();
#endif #endif /* LWIP_UDP */
#if LWIP_TCP #if LWIP_TCP
tcp_init(); tcp_init();
#endif #endif /* LWIP_TCP */
tcpip_init_done = initfunc; tcpip_init_done = initfunc;
tcpip_init_done_arg = arg; tcpip_init_done_arg = arg;

View File

@ -165,6 +165,10 @@ a lot of data that needs to be copied, this should be set high. */
#endif #endif
/* ---------- ARP options ---------- */ /* ---------- ARP options ---------- */
#ifndef LWIP_ARP
#define LWIP_ARP 1
#endif
/** Number of active hardware address, IP address pairs cached */ /** Number of active hardware address, IP address pairs cached */
#ifndef ARP_TABLE_SIZE #ifndef ARP_TABLE_SIZE
#define ARP_TABLE_SIZE 10 #define ARP_TABLE_SIZE 10