summaryrefslogtreecommitdiff
path: root/nuttx/drivers
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-03-16 17:17:58 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-03-16 17:17:58 +0000
commit33b868cdc66ba55a3849bcb953e16a6ff96c1bcd (patch)
treea0453c9dbff5a5b6d07844c2257471abc81fa1f7 /nuttx/drivers
parent476f7ff06ef2561761015980c30e8fbfe0a7f8cf (diff)
downloadpx4-nuttx-33b868cdc66ba55a3849bcb953e16a6ff96c1bcd.tar.gz
px4-nuttx-33b868cdc66ba55a3849bcb953e16a6ff96c1bcd.tar.bz2
px4-nuttx-33b868cdc66ba55a3849bcb953e16a6ff96c1bcd.zip
Fix QEMU timer interrupts
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3387 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers')
-rw-r--r--nuttx/drivers/net/slip.c21
1 files changed, 18 insertions, 3 deletions
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;
}