From aeb37c12b2f7825542d0e21d16ec822ff8d6cbad Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 10 Apr 2017 14:57:33 -0600 Subject: [PATCH] apps/wireless/wapi: Fix problems in build support. Fix some initial compile isses (still does not compile). --- include/wireless/wapi.h | 10 ++++++--- wireless/.gitignore | 2 ++ wireless/Make.defs | 37 ++++++++++++++++++++++++++++++++++ wireless/Makefile | 38 +++++++++++++++++++++++++++++++++++ wireless/wapi/Kconfig | 14 ++++++------- wireless/wapi/Makefile | 4 ++-- wireless/wapi/src/Make.defs | 2 +- wireless/wapi/src/network.c | 39 ++++++++++++++++++++++-------------- wireless/wapi/src/util.c | 2 +- wireless/wapi/src/wapi.c | 2 +- wireless/wapi/src/wireless.c | 39 ++++++++++++++++++------------------ 11 files changed, 140 insertions(+), 49 deletions(-) create mode 100644 wireless/.gitignore create mode 100644 wireless/Make.defs create mode 100644 wireless/Makefile diff --git a/include/wireless/wapi.h b/include/wireless/wapi.h index 80eb4553c..d97bb58fc 100644 --- a/include/wireless/wapi.h +++ b/include/wireless/wapi.h @@ -38,7 +38,7 @@ #include #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions @@ -72,7 +72,7 @@ typedef struct wapi_list_t wapi_list_t; typedef enum { - WAPI_FREQ_AUTO = IW_FREQ_AUTO, + WAPI_FREQ_AUTO = IW_FREQ_AUTO, WAPI_FREQ_FIXED = IW_FREQ_FIXED } wapi_freq_flag_t; @@ -314,10 +314,12 @@ int wapi_get_routes(wapi_list_t * list); * ****************************************************************************/ +#ifdef CONFIG_NET_ROUTE int wapi_add_route_gw(int sock, wapi_route_target_t targettype, FAR const struct in_addr *target, FAR const struct in_addr *netmask, FAR const struct in_addr *gw); +#endif /**************************************************************************** * Name: wapi_del_route_gw @@ -327,10 +329,12 @@ int wapi_add_route_gw(int sock, wapi_route_target_t targettype, * ****************************************************************************/ +#ifdef CONFIG_NET_ROUTE int wapi_del_route_gw(int sock, wapi_route_target_t targettype, FAR const struct in_addr *target, FAR const struct in_addr *netmask, FAR const struct in_addr *gw); +#endif /**************************************************************************** * Name: wapi_get_we_version @@ -367,7 +371,7 @@ int wapi_get_freq(int sock, FAR const char *ifname, FAR double *freq, * ****************************************************************************/ -int wapi_set_freq(int sock, FARconst char *ifname, double freq, +int wapi_set_freq(int sock, FAR const char *ifname, double freq, wapi_freq_flag_t flag); /**************************************************************************** diff --git a/wireless/.gitignore b/wireless/.gitignore new file mode 100644 index 000000000..99f41601f --- /dev/null +++ b/wireless/.gitignore @@ -0,0 +1,2 @@ +/Kconfig + diff --git a/wireless/Make.defs b/wireless/Make.defs new file mode 100644 index 000000000..6f5bcf9f7 --- /dev/null +++ b/wireless/Make.defs @@ -0,0 +1,37 @@ +############################################################################ +# apps/wireless/Make.defs +# Adds selected applications to apps/ build +# +# Copyright (C) 2017 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +include $(wildcard wireless/*/Make.defs) diff --git a/wireless/Makefile b/wireless/Makefile new file mode 100644 index 000000000..363f15cd6 --- /dev/null +++ b/wireless/Makefile @@ -0,0 +1,38 @@ +############################################################################ +# apps/wireless/Makefile +# +# Copyright (C) 2017 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +MENUDESC = "Wireless Libraries and NSH Add-Ons" + +include $(APPDIR)/Directory.mk diff --git a/wireless/wapi/Kconfig b/wireless/wapi/Kconfig index f493bd74d..4e8b7edcc 100644 --- a/wireless/wapi/Kconfig +++ b/wireless/wapi/Kconfig @@ -4,9 +4,9 @@ # menuconfig WIRELESS_WAPI - bool "Temperature" + bool "IEEE802.11 Configuration Library" default n - depends on EXPERIMENTAL + depends on NET && DRIVERS_WIRELESS && EXPERIMENTAL ---help--- Wapi is a tool by Volkan YAZICI that can be used to manage 802.11 network. @@ -14,7 +14,7 @@ menuconfig WIRELESS_WAPI if WIRELESS_WAPI config WIRELESS_WAPI_CMDTOOL - bool "Build command line tool" + bool "IEEE802.11 Command Line Tool" default n ---help--- By default, Wapi is build as only a library. If this option is @@ -22,11 +22,11 @@ config WIRELESS_WAPI_CMDTOOL will also be generated. config WIRELESS_WAPI_ENABLE_SET - bool "Enable setting options" + bool "Enable Setting Options" default n config WIRELESS_WAPI_PROGNAME - string "Program name" + string "Program Name" default "wapi" depends on BUILD_KERNEL ---help--- @@ -34,11 +34,11 @@ config WIRELESS_WAPI_PROGNAME program is installed. config WIRELESS_WAPI_STACKSIZE - int "Stack size (bytes)" + int "Stack Size (bytes)" default 2048 config WIRELESS_WAPI_PRIORITY - int "Command priority" + int "Command Priority" default 100 endif diff --git a/wireless/wapi/Makefile b/wireless/wapi/Makefile index ec335af09..02297248f 100644 --- a/wireless/wapi/Makefile +++ b/wireless/wapi/Makefile @@ -53,6 +53,8 @@ ASRCS = CSRCS = MAINSRC = +VPATH = . + include $(APPDIR)/wireless/wapi/src/Make.defs AOBJS = $(ASRCS:.S=$(OBJEXT)) @@ -89,8 +91,6 @@ ROOTDEPPATH = --dep-path . # Common build -VPATH = - all: .built .PHONY: context depend clean distclean diff --git a/wireless/wapi/src/Make.defs b/wireless/wapi/src/Make.defs index 726ac06c9..95100bb1c 100644 --- a/wireless/wapi/src/Make.defs +++ b/wireless/wapi/src/Make.defs @@ -43,7 +43,7 @@ endif DEPPATH += --dep-path src VPATH += :src -CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(APPDIR)/wirelss/wapi/src} +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(APPDIR)/wireless/wapi/src} endif diff --git a/wireless/wapi/src/network.c b/wireless/wapi/src/network.c index 893bf434d..170510ade 100644 --- a/wireless/wapi/src/network.c +++ b/wireless/wapi/src/network.c @@ -32,16 +32,19 @@ * Included Files ****************************************************************************/ -#include -#include -#include -#include #include #include #include +#include +#include +#include + +#include +#include + #include "util.h" -#include "include/wireless/wapi.h" +#include "wireless/wapi.h" /**************************************************************************** * Private Functions @@ -56,7 +59,7 @@ static int wapi_get_addr(int sock, FAR const char *ifname, int cmd, WAPI_VALIDATE_PTR(addr); strncpy(ifr.ifr_name, ifname, IFNAMSIZ); - if ((ret = ioctl(sock, cmd, &ifr)) >= 0) + if ((ret = ioctl(sock, cmd, (unsigned long)((uintptr_t)&ifr))) >= 0) { struct sockaddr_in *sin = (struct sockaddr_in *)&ifr.ifr_addr; memcpy(addr, &sin->sin_addr, sizeof(struct in_addr)); @@ -82,7 +85,7 @@ static int wapi_set_addr(int sock, FAR const char *ifname, int cmd, memcpy(&sin.sin_addr, addr, sizeof(struct in_addr)); memcpy(&ifr.ifr_addr, &sin, sizeof(struct sockaddr_in)); strncpy(ifr.ifr_name, ifname, IFNAMSIZ); - if ((ret = ioctl(sock, cmd, &ifr)) < 0) + if ((ret = ioctl(sock, cmd, (unsigned long)((uintptr_t)&ifr))) < 0) { WAPI_IOCTL_STRERROR(cmd); } @@ -90,6 +93,7 @@ static int wapi_set_addr(int sock, FAR const char *ifname, int cmd, return ret; } +#ifdef CONFIG_NET_ROUTE static int wapi_act_route_gw(int sock, int act, wapi_route_target_t targettype, FAR const struct in_addr *target, @@ -130,13 +134,14 @@ static int wapi_act_route_gw(int sock, int act, rt.rt_flags |= RTF_HOST; } - if ((ret = ioctl(sock, act, &rt)) < 0) + if ((ret = ioctl(sock, act, (unsigned long)((uintptr_t)&rt))) < 0) { WAPI_IOCTL_STRERROR(act); } return ret; } +#endif /**************************************************************************** * Public Functions @@ -161,7 +166,7 @@ int wapi_get_ifup(int sock, FAR const char *ifname, FAR int *is_up) WAPI_VALIDATE_PTR(is_up); strncpy(ifr.ifr_name, ifname, IFNAMSIZ); - if ((ret = ioctl(sock, SIOCGIFFLAGS, &ifr)) >= 0) + if ((ret = ioctl(sock, SIOCGIFFLAGS, (unsigned long)((uintptr_t)&ifr))) >= 0) { *is_up = (ifr.ifr_flags & IFF_UP) == IFF_UP; } @@ -187,10 +192,10 @@ int wapi_set_ifup(int sock, FAR const char *ifname) int ret; strncpy(ifr.ifr_name, ifname, IFNAMSIZ); - if ((ret = ioctl(sock, SIOCGIFFLAGS, &ifr)) >= 0) + if ((ret = ioctl(sock, SIOCGIFFLAGS, (unsigned long)((uintptr_t)&ifr))) >= 0) { ifr.ifr_flags |= (IFF_UP | IFF_RUNNING); - ret = ioctl(sock, SIOCSIFFLAGS, &ifr); + ret = ioctl(sock, SIOCSIFFLAGS, (unsigned long)((uintptr_t)&ifr)); } else { @@ -214,10 +219,10 @@ int wapi_set_ifdown(int sock, FAR const char *ifname) int ret; strncpy(ifr.ifr_name, ifname, IFNAMSIZ); - if ((ret = ioctl(sock, SIOCGIFFLAGS, &ifr)) >= 0) + if ((ret = ioctl(sock, SIOCGIFFLAGS, (unsigned long)((uintptr_t)&ifr))) >= 0) { ifr.ifr_flags &= ~IFF_UP; - ret = ioctl(sock, SIOCSIFFLAGS, &ifr); + ret = ioctl(sock, SIOCSIFFLAGS, (unsigned long)((uintptr_t)&ifr)); } else { @@ -296,9 +301,9 @@ int wapi_set_netmask(int sock, FAR const char *ifname, int wapi_get_routes(FAR wapi_list_t *list) { FAR FILE *fp; - int ret; size_t bufsiz = WAPI_PROC_LINE_SIZE * sizeof(char); char buf[WAPI_PROC_LINE_SIZE]; + int ret; WAPI_VALIDATE_PTR(list); @@ -389,7 +394,7 @@ int wapi_get_routes(FAR wapi_list_t *list) /* Close file. */ fclose(fp); - return 0; + return ret; } /**************************************************************************** @@ -400,6 +405,7 @@ int wapi_get_routes(FAR wapi_list_t *list) * ****************************************************************************/ +#ifdef CONFIG_NET_ROUTE int wapi_add_route_gw(int sock, wapi_route_target_t targettype, FAR const struct in_addr *target, FAR const struct in_addr *netmask, @@ -407,6 +413,7 @@ int wapi_add_route_gw(int sock, wapi_route_target_t targettype, { return wapi_act_route_gw(sock, SIOCADDRT, targettype, target, netmask, gw); } +#endif /**************************************************************************** * Name: wapi_del_route_gw @@ -416,6 +423,7 @@ int wapi_add_route_gw(int sock, wapi_route_target_t targettype, * ****************************************************************************/ +#ifdef CONFIG_NET_ROUTE int wapi_del_route_gw(int sock, wapi_route_target_t targettype, FAR const struct in_addr *target, FAR const struct in_addr *netmask, @@ -423,3 +431,4 @@ int wapi_del_route_gw(int sock, wapi_route_target_t targettype, { return wapi_act_route_gw(sock, SIOCDELRT, targettype, target, netmask, gw); } +#endif diff --git a/wireless/wapi/src/util.c b/wireless/wapi/src/util.c index 4f8729721..8b9379e46 100644 --- a/wireless/wapi/src/util.c +++ b/wireless/wapi/src/util.c @@ -39,7 +39,7 @@ #include #include -#include "include/wireless/wapi.h" +#include "wireless/wapi.h" #include "util.h" /**************************************************************************** diff --git a/wireless/wapi/src/wapi.c b/wireless/wapi/src/wapi.c index 0a029e2ee..c7a13ee3f 100644 --- a/wireless/wapi/src/wapi.c +++ b/wireless/wapi/src/wapi.c @@ -40,7 +40,7 @@ #include #include -#include "include/wireless/wapi.h" +#include "wireless/wapi.h" /* Gets current configuration of the @a ifname using WAPI accessors and prints diff --git a/wireless/wapi/src/wireless.c b/wireless/wapi/src/wireless.c index 194d1b29a..8ee1bdc83 100644 --- a/wireless/wapi/src/wireless.c +++ b/wireless/wapi/src/wireless.c @@ -38,7 +38,7 @@ #include -#include "include/wireless/wapi.h" +#include "wireless/wapi.h" #include "util.h" /**************************************************************************** @@ -351,7 +351,7 @@ int wapi_get_we_version(int sock, const char *ifname, FAR int *we_version) /* Get WE version. */ strncpy(wrq.ifr_name, ifname, IFNAMSIZ); - if ((ret = ioctl(sock, SIOCGIWRANGE, &wrq)) >= 0) + if ((ret = ioctl(sock, SIOCGIWRANGE, (unsigned long)((uintptr_t)&wrq))) >= 0) { struct iw_range *range = (struct iw_range *)buf; *we_version = (int)range->we_version_compiled; @@ -382,7 +382,7 @@ int wapi_get_freq(int sock, FAR const char *ifname, FAR double *freq, WAPI_VALIDATE_PTR(flag); strncpy(wrq.ifr_name, ifname, IFNAMSIZ); - if ((ret = ioctl(sock, SIOCGIWFREQ, &wrq)) >= 0) + if ((ret = ioctl(sock, SIOCGIWFREQ, (unsigned long)((uintptr_t)&wrq))) >= 0) { /* Set flag. */ @@ -440,7 +440,7 @@ int wapi_set_freq(int sock, FARconst char *ifname, double freq, } strncpy(wrq.ifr_name, ifname, IFNAMSIZ); - ret = ioctl(sock, SIOCSIWFREQ, &wrq); + ret = ioctl(sock, SIOCSIWFREQ, (unsigned long)((uintptr_t)&wrq)); if (ret < 0) { WAPI_IOCTL_STRERROR(SIOCSIWFREQ); @@ -479,7 +479,7 @@ int wapi_freq2chan(int sock, FAR const char *ifname, double freq, /* Get range. */ strncpy(wrq.ifr_name, ifname, IFNAMSIZ); - if ((ret = ioctl(sock, SIOCGIWRANGE, &wrq)) >= 0) + if ((ret = ioctl(sock, SIOCGIWRANGE, (unsigned long)((uintptr_t)&wrq))) >= 0) { struct iw_range *range = (struct iw_range *)buf; int k; @@ -539,7 +539,7 @@ int wapi_chan2freq(int sock, FAR const char *ifname, int chan, /* Get range. */ strncpy(wrq.ifr_name, ifname, IFNAMSIZ); - if ((ret = ioctl(sock, SIOCGIWRANGE, &wrq)) >= 0) + if ((ret = ioctl(sock, SIOCGIWRANGE, (unsigned long)((uintptr_t)&wrq))) >= 0) { struct iw_range *range = (struct iw_range *)buf; int k; @@ -591,7 +591,7 @@ int wapi_get_essid(int sock, FAR const char *ifname, FAR char *essid, wrq.u.essid.flags = 0; strncpy(wrq.ifr_name, ifname, IFNAMSIZ); - ret = ioctl(sock, SIOCGIWESSID, &wrq); + ret = ioctl(sock, SIOCGIWESSID, (unsigned long)((uintptr_t)&wrq)); if (ret < 0) { WAPI_IOCTL_STRERROR(SIOCGIWESSID); @@ -629,7 +629,7 @@ int wapi_set_essid(int sock, FAR const char *ifname, FAR const char *essid, wrq.u.essid.flags = (flag == WAPI_ESSID_ON); strncpy(wrq.ifr_name, ifname, IFNAMSIZ); - ret = ioctl(sock, SIOCSIWESSID, &wrq); + ret = ioctl(sock, SIOCSIWESSID, (unsigned long)((uintptr_t)&wrq)); if (ret < 0) { WAPI_IOCTL_STRERROR(SIOCSIWESSID); @@ -654,7 +654,7 @@ int wapi_get_mode(int sock, FAR const char *ifname, FAR wapi_mode_t *mode) WAPI_VALIDATE_PTR(mode); strncpy(wrq.ifr_name, ifname, IFNAMSIZ); - if ((ret = ioctl(sock, SIOCGIWMODE, &wrq)) >= 0) + if ((ret = ioctl(sock, SIOCGIWMODE, (unsigned long)((uintptr_t)&wrq))) >= 0) { ret = wapi_parse_mode(wrq.u.mode, mode); } @@ -682,7 +682,7 @@ int wapi_set_mode(int sock, FAR const char *ifname, wapi_mode_t mode) wrq.u.mode = mode; strncpy(wrq.ifr_name, ifname, IFNAMSIZ); - ret = ioctl(sock, SIOCSIWMODE, &wrq); + ret = ioctl(sock, SIOCSIWMODE, (unsigned long)((uintptr_t)&wrq)); if (ret < 0) { WAPI_IOCTL_STRERROR(SIOCSIWMODE); @@ -737,7 +737,7 @@ int wapi_get_ap(int sock, FAR const char *ifname, FAR struct ether_addr *ap) WAPI_VALIDATE_PTR(ap); strncpy(wrq.ifr_name, ifname, IFNAMSIZ); - if ((ret = ioctl(sock, SIOCGIWAP, &wrq)) >= 0) + if ((ret = ioctl(sock, SIOCGIWAP, (unsigned long)((uintptr_t)&wrq))) >= 0) { memcpy(ap, wrq.u.ap_addr.sa_data, sizeof(struct ether_addr)); } @@ -769,7 +769,7 @@ int wapi_set_ap(int sock, FAR const char *ifname, memcpy(wrq.u.ap_addr.sa_data, ap, sizeof(struct ether_addr)); strncpy(wrq.ifr_name, ifname, IFNAMSIZ); - ret = ioctl(sock, SIOCSIWAP, &wrq); + ret = ioctl(sock, SIOCSIWAP, (unsigned long)((uintptr_t)&wrq)); if (ret < 0) { WAPI_IOCTL_STRERROR(SIOCSIWAP); @@ -796,7 +796,7 @@ int wapi_get_bitrate(int sock, FAR const char *ifname, WAPI_VALIDATE_PTR(flag); strncpy(wrq.ifr_name, ifname, IFNAMSIZ); - if ((ret = ioctl(sock, SIOCGIWRATE, &wrq)) >= 0) + if ((ret = ioctl(sock, SIOCGIWRATE, (unsigned long)((uintptr_t)&wrq))) >= 0) { /* Check if enabled. */ if (wrq.u.bitrate.disabled) @@ -834,7 +834,7 @@ int wapi_set_bitrate(int sock, FAR const char *ifname, int bitrate, wrq.u.bitrate.fixed = (flag == WAPI_BITRATE_FIXED); strncpy(wrq.ifr_name, ifname, IFNAMSIZ); - ret = ioctl(sock, SIOCSIWRATE, &wrq); + ret = ioctl(sock, SIOCSIWRATE, (unsigned long)((uintptr_t)&wrq)); if (ret < 0) { WAPI_IOCTL_STRERROR(SIOCSIWRATE); @@ -887,7 +887,7 @@ int wapi_get_txpower(int sock, FAR const char *ifname, FAR int *power, WAPI_VALIDATE_PTR(flag); strncpy(wrq.ifr_name, ifname, IFNAMSIZ); - if ((ret = ioctl(sock, SIOCGIWTXPOW, &wrq)) >= 0) + if ((ret = ioctl(sock, SIOCGIWTXPOW, (unsigned long)((uintptr_t)&wrq))) >= 0) { /* Check if enabled. */ @@ -963,7 +963,7 @@ int wapi_set_txpower(int sock, FAR const char *ifname, int power, /* Issue the set command. */ strncpy(wrq.ifr_name, ifname, IFNAMSIZ); - ret = ioctl(sock, SIOCSIWTXPOW, &wrq); + ret = ioctl(sock, SIOCSIWTXPOW, (unsigned long)((uintptr_t)&wrq)); if (ret < 0) { WAPI_IOCTL_STRERROR(SIOCSIWTXPOW); @@ -991,7 +991,7 @@ int wapi_scan_init(int sock, const char *ifname) wrq.u.data.length = 0; strncpy(wrq.ifr_name, ifname, IFNAMSIZ); - ret = ioctl(sock, SIOCSIWSCAN, &wrq); + ret = ioctl(sock, SIOCSIWSCAN, (unsigned long)((uintptr_t)&wrq)); if (ret < 0) { WAPI_IOCTL_STRERROR(SIOCSIWSCAN); @@ -1022,7 +1022,7 @@ int wapi_scan_stat(int sock, FAR const char *ifname) wrq.u.data.length = 0; strncpy(wrq.ifr_name, ifname, IFNAMSIZ); - if ((ret = ioctl(sock, SIOCGIWSCAN, &wrq)) < 0) + if ((ret = ioctl(sock, SIOCGIWSCAN, (unsigned long)((uintptr_t)&wrq))) < 0) { if (errno == E2BIG) { @@ -1090,7 +1090,8 @@ alloc: wrq.u.data.length = buflen; wrq.u.data.flags = 0; strncpy(wrq.ifr_name, ifname, IFNAMSIZ); - if ((ret = ioctl(sock, SIOCGIWSCAN, &wrq)) < 0 && errno == E2BIG) + if ((ret = ioctl(sock, SIOCGIWSCAN, (unsigned long)((uintptr_t)&wrq))) < 0 && + errno == E2BIG) { char *tmp;