diff --git a/ports/coldfire/include/arch/errno.h b/ports/coldfire/include/arch/errno.h index edd7883..d06a9be 100644 --- a/ports/coldfire/include/arch/errno.h +++ b/ports/coldfire/include/arch/errno.h @@ -41,9 +41,4 @@ #define errno (*sys_arch_errno()) -/* Error numbers */ -#define EBADF 9 /* Bad file number */ -#define EINVAL 22 /* Invalid argument */ -#define ENOBUFS 105 /* No buffer space available */ -#define EWOULDBLOCK 40 /* We would have blocked if this was'nt non-blocking i/o */ #endif diff --git a/ports/coldfire/proj/lwipopts.h b/ports/coldfire/proj/lwipopts.h index 77b9c48..243ed6b 100644 --- a/ports/coldfire/proj/lwipopts.h +++ b/ports/coldfire/proj/lwipopts.h @@ -196,4 +196,5 @@ a lot of data that needs to be copied, this should be set high. */ #define LWIP_COMPAT_SOCKETS +#define LWIP_PROVIDE_ERRNO #endif /* __LWIPOPTS_H__ */ diff --git a/ports/coldfire/sys_arch.c b/ports/coldfire/sys_arch.c index cecc476..4afaddb 100644 --- a/ports/coldfire/sys_arch.c +++ b/ports/coldfire/sys_arch.c @@ -397,7 +397,7 @@ sys_mbox_post(sys_mbox_t mbox, void *msg) &msg, 1, NU_NO_SUSPEND); - ASSERT("sys_mbox_post: mbx post failed", status == NU_SUCCESS); + LWIP_ASSERT("sys_mbox_post: mbx post failed", status == NU_SUCCESS); } /*---------------------------------------------------------------------------------*/ u32_t diff --git a/ports/unix/include/arch/sys_arch.h b/ports/unix/include/arch/sys_arch.h index d9bdb29..6c49965 100644 --- a/ports/unix/include/arch/sys_arch.h +++ b/ports/unix/include/arch/sys_arch.h @@ -32,6 +32,9 @@ #ifndef __ARCH_SYS_ARCH_H__ #define __ARCH_SYS_ARCH_H__ +#include +#include + #define SYS_MBOX_NULL NULL #define SYS_SEM_NULL NULL diff --git a/ports/unix/proj/lib/unixlib.c b/ports/unix/proj/lib/unixlib.c index 3447dc9..22f4fbf 100644 --- a/ports/unix/proj/lib/unixlib.c +++ b/ports/unix/proj/lib/unixlib.c @@ -26,7 +26,7 @@ * * Author: Kieran Mansley * - * $Id: unixlib.c,v 1.1 2003/01/31 13:35:43 jani Exp $ + * $Id: unixlib.c,v 1.2 2003/02/06 22:18:31 davidhaas Exp $ */ /*-----------------------------------------------------------------------------------*/ @@ -83,7 +83,7 @@ void _init(void){ IP4_ADDR(&ipaddr, 192,168,1,1); IP4_ADDR(&netmask, 255,255,255,0); - netif_set_default(netif_add(&ipaddr, &netmask, &gateway, tapif_init, + netif_set_default(netif_add(&ipaddr, &netmask, &gateway, NULL, tapif_init, tcpip_input)); } diff --git a/ports/unix/proj/minimal/main.c b/ports/unix/proj/minimal/main.c index 5cdf653..49eff86 100644 --- a/ports/unix/proj/minimal/main.c +++ b/ports/unix/proj/minimal/main.c @@ -71,7 +71,7 @@ main(int argc, char **argv) IP4_ADDR(&ipaddr, 192,168,0,2); IP4_ADDR(&netmask, 255,255,255,0); - netif = netif_add(&ipaddr, &netmask, &gw, mintapif_init, ip_input); + netif = netif_add(&ipaddr, &netmask, &gw, NULL, mintapif_init, ip_input); netif_set_default(netif); diff --git a/ports/unix/proj/unixsim/lwipopts.h b/ports/unix/proj/unixsim/lwipopts.h index bb62213..a0c677d 100644 --- a/ports/unix/proj/unixsim/lwipopts.h +++ b/ports/unix/proj/unixsim/lwipopts.h @@ -123,6 +123,11 @@ a lot of data that needs to be copied, this should be set high. */ /* Maximum number of retransmissions of SYN segments. */ #define TCP_SYNMAXRTX 4 +/* TCP writable space (bytes). This must be less than or equal + to TCP_SND_BUF. It is the amount of space which must be + available in the tcp snd_buf for select to return writable */ +#define TCP_SNDLOWAT TCP_SND_BUF/2 + /* ---------- ARP options ---------- */ #define ARP_TABLE_SIZE 10 #define ARP_QUEUEING 1 diff --git a/ports/unix/proj/unixsim/simhost.c b/ports/unix/proj/unixsim/simhost.c index 313b5ff..7f2201c 100644 --- a/ports/unix/proj/unixsim/simhost.c +++ b/ports/unix/proj/unixsim/simhost.c @@ -106,7 +106,7 @@ main_thread(void *arg) IP4_ADDR(&ipaddr, 0,0,0,0); IP4_ADDR(&netmask, 0,0,0,0); - netif = netif_add(&ipaddr, &netmask, &gw, tapif_init, + netif = netif_add(&ipaddr, &netmask, &gw, NULL, tapif_init, tcpip_input); netif_set_default(netif); dhcp_init(); @@ -117,9 +117,9 @@ main_thread(void *arg) IP4_ADDR(&ipaddr, 192,168,0,2); IP4_ADDR(&netmask, 255,255,255,0); - /* netif_set_default(netif_add(&ipaddr, &netmask, &gw, tapif_init, + /* netif_set_default(netif_add(&ipaddr, &netmask, &gw, NULL, tapif_init, tcpip_input));*/ - netif_set_default(netif_add(&ipaddr, &netmask, &gw, tapif_init, + netif_set_default(netif_add(&ipaddr, &netmask, &gw, NULL, tapif_init, tcpip_input)); #endif /* Only used for testing purposes: */ @@ -127,14 +127,14 @@ main_thread(void *arg) IP4_ADDR(&ipaddr, 193,10,66,107); IP4_ADDR(&netmask, 255,255,252,0); - netif_add(&ipaddr, &netmask, &gw, pcapif_init, + netif_add(&ipaddr, &netmask, &gw, NULL, pcapif_init, tcpip_input);*/ IP4_ADDR(&gw, 127,0,0,1); IP4_ADDR(&ipaddr, 127,0,0,1); IP4_ADDR(&netmask, 255,0,0,0); - netif_add(&ipaddr, &netmask, &gw, loopif_init, + netif_add(&ipaddr, &netmask, &gw, NULL, loopif_init, tcpip_input); tcpecho_init(); diff --git a/ports/unix/proj/unixsim/simnode.c b/ports/unix/proj/unixsim/simnode.c index c494e15..20dca88 100644 --- a/ports/unix/proj/unixsim/simnode.c +++ b/ports/unix/proj/unixsim/simnode.c @@ -90,9 +90,9 @@ main_thread(void *arg) IP4_ADDR(&ipaddr, 192,168,1,2); IP4_ADDR(&netmask, 255,255,255,0); - netif_set_default(netif_add(&ipaddr, &netmask, &gw, unixif_init_client, + netif_set_default(netif_add(&ipaddr, &netmask, &gw, NULL, unixif_init_client, tcpip_input)); - /* netif_set_default(netif_add(&ipaddr, &netmask, &gw, sioslipif_init1, + /* netif_set_default(netif_add(&ipaddr, &netmask, &gw, NULL, sioslipif_init1, tcpip_input)); */ diff --git a/ports/unix/proj/unixsim/simrouter.c b/ports/unix/proj/unixsim/simrouter.c index 0e79074..6b87554 100644 --- a/ports/unix/proj/unixsim/simrouter.c +++ b/ports/unix/proj/unixsim/simrouter.c @@ -92,20 +92,20 @@ main_thread(void *arg) IP4_ADDR(&ipaddr, 192,168,0,2); IP4_ADDR(&netmask, 255,255,255,0); - netif_set_default(netif_add(&ipaddr, &netmask, &gw, tapif_init, + netif_set_default(netif_add(&ipaddr, &netmask, &gw, NULL, tapif_init, tcpip_input)); IP4_ADDR(&gw, 192,168,1,1); IP4_ADDR(&ipaddr, 192,168,1,1); IP4_ADDR(&netmask, 255,255,255,0); - netif_set_default(netif_add(&ipaddr, &netmask, &gw, unixif_init_server, + netif_set_default(netif_add(&ipaddr, &netmask, &gw, NULL, unixif_init_server, tcpip_input)); system("route add 192.168.1.1 192.168.0.2"); system("route add 192.168.1.2 192.168.0.2"); - /*netif_set_default(netif_add(&ipaddr, &netmask, &gw, sioslipif_init1, + /*netif_set_default(netif_add(&ipaddr, &netmask, &gw, NULL, sioslipif_init1, tcpip_input)); */ diff --git a/ports/unix/sys_arch.c b/ports/unix/sys_arch.c index a08556c..07e2520 100644 --- a/ports/unix/sys_arch.c +++ b/ports/unix/sys_arch.c @@ -46,7 +46,6 @@ */ #include "lwip/debug.h" -#include #include #include #include @@ -221,7 +220,7 @@ sys_mbox_post(struct sys_mbox *mbox, void *msg) sys_sem_wait(mbox->mutex); - DEBUGF(SYS_DEBUG, ("sys_mbox_post: mbox %p msg %p\n", mbox, msg)); + DEBUGF(SYS_DEBUG, ("sys_mbox_post: mbox %p msg %p\n", (void *)mbox, (void *)msg)); while((mbox->last + 1) >= (mbox->first + SYS_MBOX_SIZE)) { mbox->wait_send++; @@ -276,7 +275,7 @@ sys_arch_mbox_fetch(struct sys_mbox *mbox, void **msg, u32_t timeout) sys_arch_sem_wait(mbox->mutex, 0); } - DEBUGF(SYS_DEBUG, ("sys_mbox_fetch: mbox %p msg %p\n", mbox, *msg)); + DEBUGF(SYS_DEBUG, ("sys_mbox_fetch: mbox %p msg %p\n", (void *)mbox, *msg)); if(msg != NULL) { *msg = mbox->msgs[mbox->first % SYS_MBOX_SIZE];