summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-01-27 15:26:03 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-01-27 15:26:03 -0600
commit20190a89f724704d7a93e17163fbdfb1347b3aee (patch)
tree16c99f5e46fd12f05c7b8471c929c7c1f6f36a76
parentac637db8fc6ddae9f81445e8460666bbbb62a8d7 (diff)
downloadnuttx-20190a89f724704d7a93e17163fbdfb1347b3aee.tar.gz
nuttx-20190a89f724704d7a93e17163fbdfb1347b3aee.tar.bz2
nuttx-20190a89f724704d7a93e17163fbdfb1347b3aee.zip
Unix domain: With these changes I can build a system with no link layer enabled, only Unix domain sockets
-rw-r--r--apps/nshlib/nsh.h16
-rw-r--r--nuttx/net/netdev/netdev_register.c2
2 files changed, 17 insertions, 1 deletions
diff --git a/apps/nshlib/nsh.h b/apps/nshlib/nsh.h
index 1bd41f319..eccf5c23d 100644
--- a/apps/nshlib/nsh.h
+++ b/apps/nshlib/nsh.h
@@ -154,6 +154,22 @@
# define CONFIG_NSH_NETINIT_THREAD_PRIORITY 100
#endif
+/* Some networking commands do not make sense unless there is a network
+ * device. There might not be a network device if, for example, only Unix
+ * domain sockets were enable.
+ */
+
+#if !defined(CONFIG_NET_ETHERNET) && !defined(CONFIG_NET_SLIP)
+ /* No link layer protocol is a good indication that there is no network
+ * device.
+ */
+
+# undef CONFIG_NSH_DISABLE_IFUPDOWN
+# undef CONFIG_NSH_DISABLE_IFCONFIG
+# define CONFIG_NSH_DISABLE_IFUPDOWN 1
+# define CONFIG_NSH_DISABLE_IFCONFIG 1
+#endif
+
/* Telnetd requires networking support */
#ifndef CONFIG_NET
diff --git a/nuttx/net/netdev/netdev_register.c b/nuttx/net/netdev/netdev_register.c
index 464eef16c..a1f5c1251 100644
--- a/nuttx/net/netdev/netdev_register.c
+++ b/nuttx/net/netdev/netdev_register.c
@@ -65,7 +65,7 @@
#if defined(CONFIG_NET_SLIP)
# define NETDEV_DEFAULT_FORMAT NETDEV_SLIP_FORMAT
-#else /* `if defined(CONFIG_NET_ETHERNET) */
+#else /* if defined(CONFIG_NET_ETHERNET) */
# define NETDEV_DEFAULT_FORMAT NETDEV_ETH_FORMAT
#endif