mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 01:21:26 +08:00
network IOCTLs: Some corrections and updates to a previous commit
This commit is contained in:
@@ -136,6 +136,7 @@ config NET_6LOWPAN
|
|||||||
default n
|
default n
|
||||||
select NETDEV_MULTINIC if NET_ETHERNET || NET_LOOPBACK || NET_SLIP || NET_TUN
|
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 NET_MULTILINK if NET_ETHERNET || NET_LOOPBACK || NET_SLIP || NET_TUN
|
||||||
|
select NETDEV_IOCTL
|
||||||
depends on EXPERIMENTAL && NET_IPv6
|
depends on EXPERIMENTAL && NET_IPv6
|
||||||
---help---
|
---help---
|
||||||
Enable support for IEEE 802.15.4 Low power Wireless Personal Area
|
Enable support for IEEE 802.15.4 Low power Wireless Personal Area
|
||||||
|
|||||||
@@ -70,11 +70,12 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_NETDEV_WIRELESS_IOCTL
|
#ifdef CONFIG_NETDEV_WIRELESS_IOCTL
|
||||||
# include <nuttx/wireless/wireless.h>
|
# 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_mac.h>
|
||||||
# include <nuttx/wireless/ieee802154/ieee802154_radio.h>
|
# include <nuttx/wireless/ieee802154/ieee802154_radio.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "arp/arp.h"
|
#include "arp/arp.h"
|
||||||
#include "socket/socket.h"
|
#include "socket/socket.h"
|
||||||
@@ -379,7 +380,7 @@ static int netdev_iee802154_ioctl(FAR struct socket *psock, int cmd,
|
|||||||
FAR char *ifname;
|
FAR char *ifname;
|
||||||
int ret = -ENOTTY;
|
int ret = -ENOTTY;
|
||||||
|
|
||||||
if (req != NULL)
|
if (arg != 0ul)
|
||||||
{
|
{
|
||||||
/* Verify that this is either a valid IEEE802.15.4 radio IOCTL command
|
/* Verify that this is either a valid IEEE802.15.4 radio IOCTL command
|
||||||
* or a valid IEEE802.15.4 MAC 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;
|
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;
|
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));
|
ret = netdev_ifrioctl(psock, cmd, (FAR struct ifreq *)((uintptr_t)arg));
|
||||||
|
|
||||||
#if defined(CONFIG_NETDEV_IOCTL) && defined(CONFIG_NETDEV_WIRELESS_IOCTL)
|
#if defined(CONFIG_NETDEV_IOCTL) && defined(CONFIG_NETDEV_WIRELESS_IOCTL)
|
||||||
/* Check a wireless network command */
|
/* Check for a wireless network command */
|
||||||
|
|
||||||
if (ret == -ENOTTY)
|
if (ret == -ENOTTY)
|
||||||
{
|
{
|
||||||
@@ -1309,6 +1316,15 @@ int psock_ioctl(FAR struct socket *psock, int cmd, unsigned long arg)
|
|||||||
}
|
}
|
||||||
#endif
|
#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
|
#ifdef CONFIG_NET_IGMP
|
||||||
/* Check for address filtering commands */
|
/* Check for address filtering commands */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user