From 33b868cdc66ba55a3849bcb953e16a6ff96c1bcd Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 16 Mar 2011 17:17:58 +0000 Subject: Fix QEMU timer interrupts git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3387 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/drivers/net/slip.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'nuttx/drivers') diff --git a/nuttx/drivers/net/slip.c b/nuttx/drivers/net/slip.c index 94baab575..725d7f846 100644 --- a/nuttx/drivers/net/slip.c +++ b/nuttx/drivers/net/slip.c @@ -68,7 +68,8 @@ /* NOTE: Slip requires UART hardware handshake. If hardware handshake is * not available with your UART, then you might try the 'slattach' option - * -L which is supposed to enable "3-wire operation." + * -L which enable "3-wire operation." That allows operation without the + * hardware handshake (but with the possibility of data overrun). */ /* Configuration ************************************************************/ @@ -93,8 +94,15 @@ # define CONFIG_SLIP_DEFPRIO 128 #endif -/* The Linux slip module hard-codes its MTU size to 296. So you might as - * well set CONFIG_NET_BUFSIZE to 296 as well. +/* The Linux slip module hard-codes its MTU size to 296 (40 bytes for the + * IP+TPC headers plus 256 bytes of data). So you might as well set + * CONFIG_NET_BUFSIZE to 296 as well. + * + * There may be an issue with this setting, however. I see that Linux uses + * a MTU of 296 and window of 256, but actually only sends 168 bytes of data: + * 40 + 128. I believe that is to allow for the 2x worst cast packet + * expansion. Ideally we would like to advertise the 256 MSS, but restrict + * uIP to 128 bytes (possibly by modifying the uip_mss() macro). */ #if CONFIG_NET_BUFSIZE < 296 @@ -995,6 +1003,13 @@ int slip_initialize(int intf, const char *devname) /* Register the device with the OS so that socket IOCTLs can be performed */ (void)netdev_register(&priv->dev); + + /* When the RX and TX tasks were created, the TTY file descriptor was + * dup'ed for each task. This task no longer needs the file descriptor + * and we can safely close it. + */ + + close(priv->fd); return OK; } -- cgit v1.2.3