mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
Back out most of ebf05cb9f5
This commit is contained in:
@@ -61,7 +61,6 @@
|
||||
|
||||
#ifdef CONFIG_NET_6LOWPAN
|
||||
# include <nuttx/net/sixlowpan.h>
|
||||
# include <nuttx/wireless/wireless.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
@@ -321,51 +320,6 @@ static void ioctl_set_ipv6addr(FAR net_ipv6addr_t outaddr,
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: netdev_sixlowpan_ioctl
|
||||
*
|
||||
* Description:
|
||||
* Perform 6loWPAN network device specific operations.
|
||||
*
|
||||
* Parameters:
|
||||
* psock Socket structure
|
||||
* dev Ethernet driver device structure
|
||||
* cmd The ioctl command
|
||||
* req The argument of the ioctl cmd
|
||||
*
|
||||
* Return:
|
||||
* >=0 on success (positive non-zero values are cmd-specific)
|
||||
* Negated errno returned on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_NETDEV_IOCTL) && defined(CONFIG_NET_6LOWPAN)
|
||||
static int netdev_sixlowpan_ioctl(FAR struct socket *psock, int cmd,
|
||||
FAR struct sixlowpan_req_s *req)
|
||||
{
|
||||
#if 0 /* None yet defined */
|
||||
FAR struct ieee802154_driver_s *ieee;
|
||||
int ret = -ENOTTY;
|
||||
|
||||
/* Verify that this is a valid wireless network IOCTL command */
|
||||
|
||||
if (_WLIOCVALID(cmd) && (unsigned)_IOC_NR(cmd) <= WL_NNETCMDS)
|
||||
{
|
||||
switch (cmd)
|
||||
{
|
||||
|
||||
default:
|
||||
return -ENOTTY;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
#else
|
||||
return -ENOTTY;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: netdev_wifr_ioctl
|
||||
*
|
||||
@@ -721,7 +675,9 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int cmd,
|
||||
}
|
||||
break;
|
||||
|
||||
/* MAC address operations only make sense if Ethernet is supported */
|
||||
/* MAC address operations only make sense if Ethernet or 6loWPAN are
|
||||
* supported.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_NET_ETHERNET) || defined(CONFIG_NET_6LOWPAN)
|
||||
case SIOCGIFHWADDR: /* Get hardware address */
|
||||
@@ -1220,21 +1176,6 @@ int psock_ioctl(FAR struct socket *psock, int cmd, unsigned long arg)
|
||||
{
|
||||
int ret;
|
||||
|
||||
/* Check if this is a valid command. In all cases, arg is a pointer that has
|
||||
* been cast to unsigned long. Verify that the value of the to-be-pointer is
|
||||
* non-NULL.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_DRIVERS_WIRELESS
|
||||
if (!_SIOCVALID(cmd) && !_WLIOCVALID(cmd))
|
||||
#else
|
||||
if (!_SIOCVALID(cmd))
|
||||
#endif
|
||||
{
|
||||
ret = -ENOTTY;
|
||||
goto errout;
|
||||
}
|
||||
|
||||
/* Verify that the psock corresponds to valid, allocated socket */
|
||||
|
||||
if (psock == NULL || psock->s_crefs <= 0)
|
||||
@@ -1247,18 +1188,6 @@ int psock_ioctl(FAR struct socket *psock, int cmd, unsigned long arg)
|
||||
|
||||
ret = netdev_ifr_ioctl(psock, cmd, (FAR struct ifreq *)((uintptr_t)arg));
|
||||
|
||||
#if defined(CONFIG_NETDEV_IOCTL) && defined(CONFIG_NET_6LOWPAN)
|
||||
/* Check for a 6loWPAN network command */
|
||||
|
||||
if (ret == -ENOTTY)
|
||||
{
|
||||
FAR struct sixlowpan_req_s *slpreq;
|
||||
|
||||
slpreq = (FAR struct sixlowpan_req_s *)((uintptr_t)arg);
|
||||
ret = netdev_sixlowpan_ioctl(psock, cmd, slpreq);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_NETDEV_IOCTL) && defined(CONFIG_NETDEV_WIRELESS_IOCTL)
|
||||
/* Check for a wireless network command */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user