This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
[PATCH] LWIP over SLIP
- From: "David Ho" <davidkwho at gmail dot com>
- To: ecos-patches at sourceware dot org
- Date: Tue, 15 Aug 2006 11:09:27 -0400
- Subject: [PATCH] LWIP over SLIP
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=B26XSki5YOuaplVpTXZA0PRUD5Z+FNLjAKW4WHhsRC8h7WyTnFkq78uHc7tIC+078uoNxdSUkTBxzccKHjDuHv1LFIgBQf6Ps2Ofh7bvrA90hiWpxUMRW/EnVog0DZfYXAVMyYRMV2L0l+Ilv9fMvCrDIiNOtGq9ScoGpPi/sag=
Hi,
These are the minimal changes needed to get LWIP running over SLIP.
Plus a loopif cleanup.
David
---
diff --git a/packages/net/lwip_tcpip/current/src/ecos/init.c
b/packages/net/lwip_tcpip/current/src/ecos/init.c
index 3f55942..6aa098a 100644
--- a/packages/net/lwip_tcpip/current/src/ecos/init.c
+++ b/packages/net/lwip_tcpip/current/src/ecos/init.c
@@ -185,6 +185,8 @@ #endif
sys_sem_free(sem);
#if LWIP_HAVE_LOOPIF
+ loopif_init(&ecos_loopif);
+
IP4_ADDR(&gw, 127,0,0,1);
IP4_ADDR(&ipaddr, 127,0,0,1);
IP4_ADDR(&netmask, 255,0,0,0);
@@ -194,9 +196,8 @@ #if LWIP_HAVE_LOOPIF
#endif
#if LWIP_SLIP
- lwip_set_addr(&mynetif);
slipif_init(&mynetif);
- netif_set_default(&mynetif);
+ lwip_set_addr(&mynetif);
#elif PPP_SUPPORT
pppInit();
#if PAP_SUPPORT || CHAP_SUPPORT
diff --git a/packages/net/lwip_tcpip/current/src/ecos/sio.c
b/packages/net/lwip_tcpip/current/src/ecos/sio.c
index 60004c4..87a4eb7 100644
--- a/packages/net/lwip_tcpip/current/src/ecos/sio.c
+++ b/packages/net/lwip_tcpip/current/src/ecos/sio.c
@@ -82,7 +82,7 @@ void *
sio_open(int devnum)
{
int res;
- cyg_uint32 nb = 0, len = 4;
+ cyg_uint32 nb = 1, len = 4;
#if LWIP_SLIP
#define SIODEV SLIP_DEV
@@ -95,9 +95,11 @@ #endif
res = cyg_io_set_config(ser, CYG_IO_SET_CONFIG_READ_BLOCKING,
&nb, &len);
res = cyg_io_set_config(ser, CYG_IO_SET_CONFIG_WRITE_BLOCKING,
&nb, &len);
+#if 0
len = 4;
nb = 0xFFFFFFFF;
res = cyg_io_set_config(ser,
CYG_IO_SET_CONFIG_SERIAL_FLOW_CONTROL_METHOD, &nb, &len);
+#endif
if (res != ENOERR)
diag_printf("set_config flow_control returned
an error\n");
return &ser;