From 8769a224cc0677776a91b71212fe0da887ba758b Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 1 Sep 2007 18:06:15 +0000 Subject: [PATCH] Added support for socket descriptors git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@318 42af7a65-404d-4744-a932-0658087f49c3 --- arch/sim/src/Makefile | 2 +- arch/sim/src/up_idle.c | 2 +- arch/sim/src/up_initialize.c | 2 +- arch/sim/src/up_internal.h | 4 ++-- arch/sim/src/up_uipdriver.c | 10 +++++----- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/sim/src/Makefile b/arch/sim/src/Makefile index f9eaeac498..75ea07eee4 100644 --- a/arch/sim/src/Makefile +++ b/arch/sim/src/Makefile @@ -49,7 +49,7 @@ CSRCS = up_initialize.c up_idle.c up_interruptcontext.c \ ifeq ($(CONFIG_FS_FAT),y) CSRCS += up_blockdevice.c up_deviceimage.c endif -ifeq ($(CONFIG_NET_UIP),y) +ifeq ($(CONFIG_NET),y) CSRCS += up_uipdriver.c SPECSRCS += up_tapdev.c endif diff --git a/arch/sim/src/up_idle.c b/arch/sim/src/up_idle.c index 95e119240a..01457962e6 100644 --- a/arch/sim/src/up_idle.c +++ b/arch/sim/src/up_idle.c @@ -83,7 +83,7 @@ void up_idle(void) /* Run the network if enabled */ -#ifdef CONFIG_NET_UIP +#ifdef CONFIG_NET uipdriver_loop(); #endif } diff --git a/arch/sim/src/up_initialize.c b/arch/sim/src/up_initialize.c index 427360c10c..a7faa50329 100644 --- a/arch/sim/src/up_initialize.c +++ b/arch/sim/src/up_initialize.c @@ -86,7 +86,7 @@ void up_initialize(void) devnull_register(); /* Standard /dev/null */ up_devconsole(); /* Our private /dev/console */ up_registerblockdevice(); /* Our simulated block device /dev/blkdev */ -#ifdef CONFIG_NET_UIP +#ifdef CONFIG_NET uipdriver_init(); /* Our "real" netwok driver */ #endif } diff --git a/arch/sim/src/up_internal.h b/arch/sim/src/up_internal.h index f2a7512a02..f2a2b65cb4 100644 --- a/arch/sim/src/up_internal.h +++ b/arch/sim/src/up_internal.h @@ -109,7 +109,7 @@ extern char *up_deviceimage(void); /* up_tapdev.c ************************************************************/ -#ifdef CONFIG_NET_UIP +#ifdef CONFIG_NET extern unsigned long up_getwalltime( void ); extern void tapdev_init(void); extern unsigned int tapdev_read(char *buf, unsigned int buflen); @@ -118,7 +118,7 @@ extern void tapdev_send(char *buf, unsigned int buflen); /* up_uipdriver.c *********************************************************/ -#ifdef CONFIG_NET_UIP +#ifdef CONFIG_NET extern int uipdriver_init(void); extern void uipdriver_loop(void); #endif diff --git a/arch/sim/src/up_uipdriver.c b/arch/sim/src/up_uipdriver.c index 883207ab4d..5309b89c4a 100644 --- a/arch/sim/src/up_uipdriver.c +++ b/arch/sim/src/up_uipdriver.c @@ -106,7 +106,7 @@ void uipdriver_loop(void) { int i; - uip_len = tapdev_read(uip_buf, UIP_BUFSIZE); + uip_len = tapdev_read((char*)uip_buf, UIP_BUFSIZE); if (uip_len > 0) { if (BUF->type == htons(UIP_ETHTYPE_IP)) @@ -122,7 +122,7 @@ void uipdriver_loop(void) if (uip_len > 0) { uip_arp_out(); - tapdev_send(uip_buf, uip_len); + tapdev_send((char*)uip_buf, uip_len); } } else if (BUF->type == htons(UIP_ETHTYPE_ARP)) @@ -136,7 +136,7 @@ void uipdriver_loop(void) if (uip_len > 0) { - tapdev_send(uip_buf, uip_len); + tapdev_send((char*)uip_buf, uip_len); } } } @@ -155,7 +155,7 @@ void uipdriver_loop(void) if (uip_len > 0) { uip_arp_out(); - tapdev_send(uip_buf, uip_len); + tapdev_send((char*)uip_buf, uip_len); } } @@ -172,7 +172,7 @@ void uipdriver_loop(void) if (uip_len > 0) { uip_arp_out(); - tapdev_send(uip_buf, uip_len); + tapdev_send((char*)uip_buf, uip_len); } } #endif /* UIP_UDP */