network IOCTLs: Some corrections and updates to a previous commit

This commit is contained in:
Gregory Nutt
2017-04-15 10:23:29 -06:00
parent 30db2835a1
commit 54939d4616
2 changed files with 23 additions and 6 deletions
+1
View File
@@ -136,6 +136,7 @@ config NET_6LOWPAN
default n
select NETDEV_MULTINIC if NET_ETHERNET || NET_LOOPBACK || NET_SLIP || NET_TUN
select NET_MULTILINK if NET_ETHERNET || NET_LOOPBACK || NET_SLIP || NET_TUN
select NETDEV_IOCTL
depends on EXPERIMENTAL && NET_IPv6
---help---
Enable support for IEEE 802.15.4 Low power Wireless Personal Area
+22 -6
View File
@@ -70,11 +70,12 @@
#ifdef CONFIG_NETDEV_WIRELESS_IOCTL
# include <nuttx/wireless/wireless.h>
#ifdef CONFIG_NET_6LOWPAN
#endif
#if defined(CONFIG_NETDEV_IOCTL) && defined(CONFIG_NET_6LOWPAN)
# include <nuttx/wireless/ieee802154/ieee802154_mac.h>
# include <nuttx/wireless/ieee802154/ieee802154_radio.h>
#endif
#endif
#include "arp/arp.h"
#include "socket/socket.h"
@@ -379,7 +380,7 @@ static int netdev_iee802154_ioctl(FAR struct socket *psock, int cmd,
FAR char *ifname;
int ret = -ENOTTY;
if (req != NULL)
if (arg != 0ul)
{
/* Verify that this is either a valid IEEE802.15.4 radio IOCTL command
* or a valid IEEE802.15.4 MAC IOCTL command.
@@ -414,9 +415,15 @@ static int netdev_iee802154_ioctl(FAR struct socket *psock, int cmd,
return -ENOTTY;
}
/* Perform the device IOCTL */
/* Find the device with this name */
ret = dev->d_ioctl(dev, cmd, arg);
dev = netdev_findbyname(ifname);
if (dev != NULL)
{
/* Perform the device IOCTL */
ret = dev->d_ioctl(dev, cmd, arg);
}
}
return ret;
@@ -1301,7 +1308,7 @@ int psock_ioctl(FAR struct socket *psock, int cmd, unsigned long arg)
ret = netdev_ifrioctl(psock, cmd, (FAR struct ifreq *)((uintptr_t)arg));
#if defined(CONFIG_NETDEV_IOCTL) && defined(CONFIG_NETDEV_WIRELESS_IOCTL)
/* Check a wireless network command */
/* Check for a wireless network command */
if (ret == -ENOTTY)
{
@@ -1309,6 +1316,15 @@ int psock_ioctl(FAR struct socket *psock, int cmd, unsigned long arg)
}
#endif
#if defined(CONFIG_NETDEV_IOCTL) && defined(CONFIG_NET_6LOWPAN)
/* Check for a IEEE802.15.4 network device command */
if (ret == -ENOTTY)
{
ret = netdev_iee802154_ioctl(psock, cmd, arg);
}
#endif
#ifdef CONFIG_NET_IGMP
/* Check for address filtering commands */