summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-11-15 08:55:50 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-11-15 08:55:50 -0600
commit8eb364cb976a72a27459f83692b56d6eed834e4d (patch)
tree412f27b042d6fd749715deea05a00cf42ac7464c
parent77584d83c684ff6a6ee2b1c334fdb67400aa405e (diff)
downloadpx4-nuttx-8eb364cb976a72a27459f83692b56d6eed834e4d.tar.gz
px4-nuttx-8eb364cb976a72a27459f83692b56d6eed834e4d.tar.bz2
px4-nuttx-8eb364cb976a72a27459f83692b56d6eed834e4d.zip
Network: Misc fixes for clean complete with both Ethernet and SLIP enabled
-rw-r--r--nuttx/drivers/net/slip.c6
-rw-r--r--nuttx/include/nuttx/net/netconfig.h7
-rw-r--r--nuttx/net/Kconfig61
-rw-r--r--nuttx/net/arp/arp_send.c5
-rw-r--r--nuttx/net/netdev/netdev_register.c3
5 files changed, 40 insertions, 42 deletions
diff --git a/nuttx/drivers/net/slip.c b/nuttx/drivers/net/slip.c
index f1533be80..2585ac34c 100644
--- a/nuttx/drivers/net/slip.c
+++ b/nuttx/drivers/net/slip.c
@@ -961,7 +961,8 @@ int slip_initialize(int intf, FAR const char *devname)
argv[1] = NULL;
priv->rxpid = task_create("rxslip", CONFIG_SLIP_DEFPRIO,
- CONFIG_SLIP_STACKSIZE, (main_t)slip_rxtask, argv);
+ CONFIG_SLIP_STACKSIZE, (main_t)slip_rxtask,
+ (FAR char * const *)argv);
if (priv->rxpid < 0)
{
ndbg("ERROR: Failed to start receiver task\n");
@@ -975,7 +976,8 @@ int slip_initialize(int intf, FAR const char *devname)
/* Start the SLIP transmitter task */
priv->txpid = task_create("txslip", CONFIG_SLIP_DEFPRIO,
- CONFIG_SLIP_STACKSIZE, (main_t)slip_txtask, argv);
+ CONFIG_SLIP_STACKSIZE, (main_t)slip_txtask,
+ (FAR char * const *)argv);
if (priv->txpid < 0)
{
ndbg("ERROR: Failed to start receiver task\n");
diff --git a/nuttx/include/nuttx/net/netconfig.h b/nuttx/include/nuttx/net/netconfig.h
index 72f3c3e5d..9a6ed5167 100644
--- a/nuttx/include/nuttx/net/netconfig.h
+++ b/nuttx/include/nuttx/net/netconfig.h
@@ -82,17 +82,12 @@
* should be set to 0.
*/
-#undef CONFIG_NET_ETHERNET
-#undef CONFIG_NET_ARP
-
#ifdef CONFIG_NET_SLIP
# ifdef CONFIG_NET_IPv6
-# error "SLIP is not implemented for IPv6"
+# error SLIP is not available for IPv6
# endif
# define NET_LL_HDRLEN 0
#else
-# define CONFIG_NET_ETHERNET 1
-# define CONFIG_NET_ARP 1
# define NET_LL_HDRLEN 14
#endif
diff --git a/nuttx/net/Kconfig b/nuttx/net/Kconfig
index bb4d421a5..2eba66c9e 100644
--- a/nuttx/net/Kconfig
+++ b/nuttx/net/Kconfig
@@ -88,42 +88,15 @@ config NET_GUARDSIZE
packet size will be chopped down to the size indicated in the TCP
header.
-source "net/socket/Kconfig"
-source "net/netdev/Kconfig"
-source "net/ipv6/Kconfig"
-source "net/pkt/Kconfig"
-source "net/tcp/Kconfig"
-source "net/udp/Kconfig"
-source "net/icmp/Kconfig"
-source "net/igmp/Kconfig"
-source "net/arp/Kconfig"
-source "net/iob/Kconfig"
-source "net/utils/Kconfig"
-
-config NET_STATISTICS
- bool "Collect network statistics"
- default n
- ---help---
- uIP statistics on or off
-
-source "net/route/Kconfig"
-
-config NET_MULTICAST
- bool "Multi-cast Tx support"
- default n
- ---help---
- Outgoing multi-cast address support
-
-# Select Data Link
+menu "Data link support"
config NET_MULTILINK
bool
default n
config NET_ETHERNET
- bool
- default y if !NET_SLIP
- default n if NET_SLIP
+ bool "Ethernet support"
+ default y
select NETDEV_MULTINIC if NET_SLIP
select NET_MULTILINK if NET_SLIP
---help---
@@ -182,4 +155,32 @@ config SLIP_DEFPRIO
The priority of the SLIP RX and TX tasks. Default: 128
endif # NET_SLIP
+endmenu # Data link support
+
+source "net/socket/Kconfig"
+source "net/netdev/Kconfig"
+source "net/ipv6/Kconfig"
+source "net/pkt/Kconfig"
+source "net/tcp/Kconfig"
+source "net/udp/Kconfig"
+source "net/icmp/Kconfig"
+source "net/igmp/Kconfig"
+source "net/arp/Kconfig"
+source "net/iob/Kconfig"
+source "net/utils/Kconfig"
+
+config NET_STATISTICS
+ bool "Collect network statistics"
+ default n
+ ---help---
+ uIP statistics on or off
+
+source "net/route/Kconfig"
+
+config NET_MULTICAST
+ bool "Multi-cast Tx support"
+ default n
+ ---help---
+ Outgoing multi-cast address support
+
endif # NET
diff --git a/nuttx/net/arp/arp_send.c b/nuttx/net/arp/arp_send.c
index d03c6005e..8433aa964 100644
--- a/nuttx/net/arp/arp_send.c
+++ b/nuttx/net/arp/arp_send.c
@@ -40,6 +40,7 @@
#include <nuttx/config.h>
#include <unistd.h>
+#include <string.h>
#include <semaphore.h>
#include <time.h>
#include <debug.h>
@@ -97,7 +98,7 @@ static uint16_t arp_send_interrupt(FAR struct net_driver_s *dev,
#ifdef CONFIG_NETDEV_MULTINIC
/* Is this the device that we need to route this request? */
- if (strncmp(dev->d_ifname, state->snd_ifname, IFNAMSIZ) != 0)
+ if (strncmp((FAR const char *)dev->d_ifname, (FAR const char *)state->snd_ifname, IFNAMSIZ) != 0)
{
/* No... pass on this one and wait for the device that we want */
@@ -295,7 +296,7 @@ int arp_send(in_addr_t ipaddr)
#ifdef CONFIG_NETDEV_MULTINIC
/* Remember the routing device name */
- strncpy(state->snd_ifname, dev->d_ifname, IFNAMSIZ);
+ strncpy((FAR char *)state.snd_ifname, (FAR const char *)dev->d_ifname, IFNAMSIZ);
#endif
/* Now loop, testing if the address mapping is in the ARP table and re-sending the ARP request if it is not.
diff --git a/nuttx/net/netdev/netdev_register.c b/nuttx/net/netdev/netdev_register.c
index 818a3c7d9..b9464bd72 100644
--- a/nuttx/net/netdev/netdev_register.c
+++ b/nuttx/net/netdev/netdev_register.c
@@ -147,7 +147,6 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
dev->d_llhdrlen = 0;
break;
#endif
- break;
/* REVISIT: Here we must also set the size of the link header
* header the precedes network layer headers.
@@ -162,7 +161,7 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
/* Remember the verified link type */
- dev->d_lltype = (uint8_t)lltype
+ dev->d_lltype = (uint8_t)lltype;
#endif
/* Assign a device name to the interface */