From 08a603c77b99ade6a63938a62e1cd785e9fabd25 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 13 Mar 2011 15:12:31 +0000 Subject: SLIP corrections git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3376 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/include/net/uip/uip-arch.h | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) (limited to 'nuttx/include') diff --git a/nuttx/include/net/uip/uip-arch.h b/nuttx/include/net/uip/uip-arch.h index 49608de49..2cbe7239c 100644 --- a/nuttx/include/net/uip/uip-arch.h +++ b/nuttx/include/net/uip/uip-arch.h @@ -102,33 +102,23 @@ struct uip_driver_s uip_ipaddr_t d_draddr; /* Default router IP address */ uip_ipaddr_t d_netmask; /* Network subnet mask */ - /* The d_buf array is used to hold incoming and outgoing - * packets. The device driver should place incoming data into this - * buffer. When sending data, the device driver should read the link - * level headers and the TCP/IP headers from this buffer. The size of - * the link level headers is configured by the UIP_LLH_LEN define. + /* The d_buf array is used to hold incoming and outgoing packets. The device + * driver should place incoming data into this buffer. When sending data, + * the device driver should read the link level headers and the TCP/IP + * headers from this buffer. The size of the link level headers is + * configured by the UIP_LLH_LEN define. * - * Note: The application data need not be placed in this buffer, so - * the device driver must read it from the place pointed to by the - * d_appdata pointer as illustrated by the following example: - * - * void - * devicedriver_send(void) - * { - * hwsend(&dev->d_buf[0], UIP_LLH_LEN); - * if(dev->d_len <= UIP_LLH_LEN + UIP_TCPIP_HLEN) - * { - * hwsend(&dev->d_buf[UIP_LLH_LEN], dev->d_len - UIP_LLH_LEN); - * } - * else - * { - * hwsend(&dev->d_buf[UIP_LLH_LEN], UIP_TCPIP_HLEN); - * hwsend(dev->d_appdata, dev->d_len - UIP_TCPIP_HLEN - UIP_LLH_LEN); - * } - * } + * uIP will handle only a single buffer for both incoming and outgoing + * packets. However, the drive design may be concurrently send and + * filling separate, break-off buffers if CONFIG_NET_MULTIBUFFER is + * defined. That buffer management must be controlled by the driver. */ +#ifdef CONFIG_NET_MULTIBUFFER + uint8_t *d_buf; +#else uint8_t d_buf[CONFIG_NET_BUFSIZE + 2]; +#endif /* d_appdata points to the location where application data can be read from * or written into a packet. -- cgit v1.2.3