From 14d8d2b9e441b31ad9944186b94c64046d9a53e5 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Sun, 21 Feb 2010 11:26:15 +0000 Subject: [PATCH] Fixed compilation of proj/lib --- ports/unix/netif/tapif.c | 6 +++++- ports/unix/netif/tcpdump.c | 4 ++++ ports/unix/netif/tunif.c | 4 ++++ ports/unix/netif/unixif.c | 16 +++++++--------- ports/unix/proj/lib/Makefile | 6 +++--- ports/unix/sys_arch.c | 2 ++ 6 files changed, 25 insertions(+), 13 deletions(-) diff --git a/ports/unix/netif/tapif.c b/ports/unix/netif/tapif.c index 5e18f50..984a376 100644 --- a/ports/unix/netif/tapif.c +++ b/ports/unix/netif/tapif.c @@ -72,6 +72,10 @@ #define IFNAME0 't' #define IFNAME1 'p' +#ifndef TAPIF_DEBUG +#define TAPIF_DEBUG LWIP_DBG_OFF +#endif + struct tapif { struct eth_addr *ethaddr; /* Add whatever per-interface state that is needed here. */ @@ -332,7 +336,7 @@ tapif_init(struct netif *netif) netif->name[1] = IFNAME1; netif->output = etharp_output; netif->linkoutput = low_level_output; - netif->mtu = 1500; + netif->mtu = 1500; /* hardware address length */ netif->hwaddr_len = 6; diff --git a/ports/unix/netif/tcpdump.c b/ports/unix/netif/tcpdump.c index b579e3a..dd6e5c3 100644 --- a/ports/unix/netif/tcpdump.c +++ b/ports/unix/netif/tcpdump.c @@ -39,6 +39,10 @@ #include "lwip/inet.h" #include "lwip/inet_chksum.h" +#ifndef TCPDUMP_DEBUG +#define TCPDUMP_DEBUG LWIP_DBG_OFF +#endif + static FILE *file = NULL; /*-----------------------------------------------------------------------------------*/ diff --git a/ports/unix/netif/tunif.c b/ports/unix/netif/tunif.c index e1f939a..33af594 100644 --- a/ports/unix/netif/tunif.c +++ b/ports/unix/netif/tunif.c @@ -54,6 +54,10 @@ #define IFNAME0 't' #define IFNAME1 'n' +#ifndef TUNIF_DEBUG +#define TUNIF_DEBUG LWIP_DBG_OFF +#endif + struct tunif { /* Add whatever per-interface state that is needed here. */ int fd; diff --git a/ports/unix/netif/unixif.c b/ports/unix/netif/unixif.c index 0afc5c0..acfa665 100644 --- a/ports/unix/netif/unixif.c +++ b/ports/unix/netif/unixif.c @@ -62,6 +62,10 @@ #define UNIXIF_QUEUELEN 6 /*#define UNIXIF_DROP_FIRST */ +#ifndef UNIXIF_DEBUG +#define UNIXIF_DEBUG LWIP_DBG_OFF +#endif + struct unixif_buf { struct pbuf *p; unsigned short len, tot_len; @@ -225,9 +229,7 @@ unixif_input_handler(void *data) q = q->next; } pbuf_realloc(p, len); -#ifdef LINK_STATS - lwip_stats.link.recv++; -#endif /* LINK_STATS */ + LINK_STATS_INC(link.recv); tcpdump(p); netif->input(p, netif); } else { @@ -319,9 +321,7 @@ unixif_output(struct netif *netif, struct pbuf *p, ip_addr_t *ipaddr) LWIP_DEBUGF(UNIXIF_DEBUG, ("unixif_output: drop\n")); #endif /* UNIXIF_DROP_FIRST */ -#ifdef LINK_STATS - lwip_stats.link.drop++; -#endif /* LINK_STATS */ + LINK_STATS_INC(link.drop); } else { LWIP_DEBUGF(UNIXIF_DEBUG, ("unixif_output: on list\n")); @@ -393,9 +393,7 @@ unixif_output_timeout(void *arg) abort(); } tcpdump(p); -#ifdef LINK_STATS - lwip_stats.link.xmit++; -#endif /* LINK_STATS */ + LINK_STATS_INC(link.xmit); free(data); free(buf); diff --git a/ports/unix/proj/lib/Makefile b/ports/unix/proj/lib/Makefile index df95f47..fe00fd7 100644 --- a/ports/unix/proj/lib/Makefile +++ b/ports/unix/proj/lib/Makefile @@ -43,7 +43,7 @@ CFLAGS=-g -Wall -DIPv4 -DLWIP_DEBUG CFLAGS:=$(CFLAGS) \ -I$(LWIPDIR)/include -I$(LWIPARCH)/include -I$(LWIPDIR)/include/ipv4 \ - -Iapps -I. + -I$(LWIPDIR) -I. # COREFILES, CORE4FILES: The minimum set of files needed for lwIP. COREFILES=$(LWIPDIR)/core/mem.c $(LWIPDIR)/core/memp.c $(LWIPDIR)/core/netif.c \ @@ -53,7 +53,7 @@ COREFILES=$(LWIPDIR)/core/mem.c $(LWIPDIR)/core/memp.c $(LWIPDIR)/core/netif.c \ $(LWIPDIR)/core/def.c $(LWIPDIR)/core/timers.c CORE4FILES=$(LWIPDIR)/core/ipv4/icmp.c $(LWIPDIR)/core/ipv4/ip.c \ $(LWIPDIR)/core/ipv4/inet.c $(LWIPDIR)/core/ipv4/ip_addr.c \ - $(LWIPDIR)/core/ipv4/inet_chksum.c + $(LWIPDIR)/core/ipv4/inet_chksum.c $(LWIPDIR)/core/ipv4/ip_frag.c # APIFILES: The files which implement the sequential and socket APIs. @@ -64,7 +64,7 @@ APIFILES=$(LWIPDIR)/api/api_lib.c $(LWIPDIR)/api/api_msg.c $(LWIPDIR)/api/tcpip. NETIFFILES=$(LWIPDIR)/netif/etharp.c # ARCHFILES: Architecture specific files. -ARCHFILES=$(wildcard $(LWIPDIR)/arch/$(LWIPARCH)/*.c $(LWIPDIR)/arch/$(LWIPARCH)/netif/*.c) +ARCHFILES=$(wildcard $(LWIPARCH)/*.c $(LWIPARCH)/netif/tapif.c $(LWIPARCH)/netif/tunif.c $(LWIPARCH)/netif/unixif.c $(LWIPARCH)/netif/list.c $(LWIPARCH)/netif/tcpdump.c) # LWIPFILES: All the above. LWIPFILES=$(COREFILES) $(CORE4FILES) $(APIFILES) $(NETIFFILES) $(ARCHFILES) diff --git a/ports/unix/sys_arch.c b/ports/unix/sys_arch.c index 1c394b1..de4a582 100644 --- a/ports/unix/sys_arch.c +++ b/ports/unix/sys_arch.c @@ -93,9 +93,11 @@ struct sys_thread { pthread_t pthread; }; +#if SYS_LIGHTWEIGHT_PROT static pthread_mutex_t lwprot_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_t lwprot_thread = (pthread_t)0xDEAD; static int lwprot_count = 0; +#endif /* SYS_LIGHTWEIGHT_PROT */ static struct sys_sem *sys_sem_new_internal(u8_t count); static void sys_sem_free_internal(struct sys_sem *sem);