From 7c6f2c3c9a7171f85912052860d43d1b98d96ddc Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 21 Apr 2017 18:31:05 -0600 Subject: [PATCH] Back out most of ebf05cb9f56278b03965f86ea8a1c33634cbfec5 --- include/nuttx/wireless/wireless.h | 46 +----------------- net/netdev/netdev_ioctl.c | 77 ++----------------------------- 2 files changed, 4 insertions(+), 119 deletions(-) diff --git a/include/nuttx/wireless/wireless.h b/include/nuttx/wireless/wireless.h index a9abf706b6..a09c2bb148 100644 --- a/include/nuttx/wireless/wireless.h +++ b/include/nuttx/wireless/wireless.h @@ -63,7 +63,6 @@ * interface. */ -/* IEEE802.11 */ /* Wireless identification */ #define SIOCSIWCOMMIT _WLIOC(0x0001) /* Commit pending changes to driver */ @@ -154,19 +153,6 @@ #define SIOCSIWPMKSA _WLIOC(0x0032) /* PMKSA cache operation */ -/* IEEE802.15.4 6loWPAN - * - * IEEE802.15.4 IOCTLs may be directed at one of three layers: - * - * 1. To the 6loWPAN network layer, as documented here, - * 2. To the IEEE802.15.4 MAC layer, as documented in, - * include/nuttx/wireless/ieee802154/ioeee802154_mac.h, or to - * 3. To the IEEE802.15.4 radio device layer, as documented in, - * include/nuttx/wireless/ieee802154/ioeee802154_radio.h. - * - * This is a placeholder; no 6LoWPAN IOCTL commands have been defined. - */ - #define WL_FIRSTCHAR 0x0033 #define WL_NNETCMDS 0x0032 @@ -184,7 +170,7 @@ * of the address is driver specific */ #define WLIOC_GETADDR _WLIOC(0x0036) /* arg: Pointer to address value, format * of the address is driver specific */ -#define WLIOC_SETTXPOWER _WLIOC(0x0036) /* arg: Pointer to int32_t, output power +#define WLIOC_SETTXPOWER _WLIOC(0x0037) /* arg: Pointer to int32_t, output power * (in dBm) */ #define WLIOC_GETTXPOWER _WLIOC(0x0038) /* arg: Pointer to int32_t, output power * (in dBm) */ @@ -369,35 +355,5 @@ struct iw_event union iwreq_data u; /* Fixed IOCTL payload */ }; -/* 6loWPAN */ -/* This structure is used with the SIOCSWPANID IOCTL command to select the - * PAN ID to join. - */ - -struct sixlowpan_panid_s -{ - uint16_t panid; /* The PAN ID to join */ -}; - -/* This union defines the data payload of an 6loWPAN or SIOCGWPANID ioctl - * command and is used in struct sixlowpan_req_s below. - */ - -union sixlowpan_data -{ - struct sixlowpan_panid_s panid; /* PAN ID to join */ -}; - -/* This is the structure used to exchange data in wireless IOCTLs. This - * structure is the same as 'struct ifreq', but defined for use with - * 6loWPAN IOCTLs. - */ - -struct sixlowpan_req_s -{ - char ifr_name[IFNAMSIZ]; /* Interface name, e.g. "wpan0" */ - union sixlowpan_data u; /* Data payload */ -}; - #endif /* CONFIG_DRIVERS_WIRELESS */ #endif /* __INCLUDE_NUTTX_WIRELESS_WIRELESS_H */ diff --git a/net/netdev/netdev_ioctl.c b/net/netdev/netdev_ioctl.c index 17ac9f51d3..f42acbeedb 100644 --- a/net/netdev/netdev_ioctl.c +++ b/net/netdev/netdev_ioctl.c @@ -61,7 +61,6 @@ #ifdef CONFIG_NET_6LOWPAN # include -# include #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 */