From a1341780347cc3a350a01489c10b6767a3caafd2 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 26 Apr 2017 12:30:18 -0600 Subject: [PATCH] Enabled wireless IOCTL commands in photon/wlan configuration --- configs/photon/wlan/defconfig | 4 +- drivers/wireless/ieee80211/bcmf_netdev.c | 66 ++++++++++++++++++++++-- 2 files changed, 65 insertions(+), 5 deletions(-) diff --git a/configs/photon/wlan/defconfig b/configs/photon/wlan/defconfig index d1cae5539d..ca7cd23619 100644 --- a/configs/photon/wlan/defconfig +++ b/configs/photon/wlan/defconfig @@ -16,7 +16,7 @@ CONFIG_HOST_LINUX=y # # Build Configuration # -CONFIG_APPS_DIR="../apps" +# CONFIG_APPS_DIR="../apps" CONFIG_BUILD_FLAT=y # CONFIG_BUILD_2PASS is not set @@ -1005,7 +1005,7 @@ CONFIG_NET_ETHERNET=y # # CONFIG_NETDEV_IOCTL is not set # CONFIG_NETDEV_PHY_IOCTL is not set -# CONFIG_NETDEV_WIRELESS_IOCTL is not set +CONFIG_NETDEV_WIRELESS_IOCTL=y # # Internet Protocol Selection diff --git a/drivers/wireless/ieee80211/bcmf_netdev.c b/drivers/wireless/ieee80211/bcmf_netdev.c index 5d94d9e583..b81ced26dd 100644 --- a/drivers/wireless/ieee80211/bcmf_netdev.c +++ b/drivers/wireless/ieee80211/bcmf_netdev.c @@ -56,6 +56,7 @@ #include #include #include +#include #ifdef CONFIG_NET_PKT # include @@ -1088,14 +1089,73 @@ static int bcmf_ioctl(FAR struct net_driver_s *dev, int cmd, switch (cmd) { - /* Add cases here to support the IOCTL commands */ + case SIOCSIWFREQ: /* Set channel/frequency (Hz) */ + wlwarn("WARNING: SIOCSIWFREQ not implemented\n"); + ret = -ENOSYS; + break; + + case SIOCGIWFREQ: /* Get channel/frequency (Hz) */ + wlwarn("WARNING: SIOCGIWFREQ not implemented\n"); + ret = -ENOSYS; + break; + + case SIOCSIWMODE: /* Set operation mode */ + wlwarn("WARNING: SIOCSIWMODE not implemented\n"); + ret = -ENOSYS; + break; + + case SIOCGIWMODE: /* Get operation mode */ + wlwarn("WARNING: SIOCGIWMODE not implemented\n"); + ret = -ENOSYS; + break; + + case SIOCSIWAP: /* Set access point MAC addresses */ + wlwarn("WARNING: SIOCSIWAP not implemented\n"); + ret = -ENOSYS; + break; + + case SIOCGIWAP: /* Get access point MAC addresses */ + wlwarn("WARNING: SIOCGIWAP not implemented\n"); + ret = -ENOSYS; + break; + + case SIOCSIWESSID: /* Set ESSID (network name) */ + wlwarn("WARNING: SIOCSIWESSID not implemented\n"); + ret = -ENOSYS; + break; + + case SIOCGIWESSID: /* Get ESSID */ + wlwarn("WARNING: SIOCGIWESSID not implemented\n"); + ret = -ENOSYS; + break; + + case SIOCSIWRATE: /* Set default bit rate (bps) */ + wlwarn("WARNING: SIOCSIWRATE not implemented\n"); + ret = -ENOSYS; + break; + + case SIOCGIWRATE: /* Get default bit rate (bps) */ + wlwarn("WARNING: SIOCGIWRATE not implemented\n"); + ret = -ENOSYS; + break; + + case SIOCSIWTXPOW: /* Set transmit power (dBm) */ + wlwarn("WARNING: SIOCSIWTXPOW not implemented\n"); + ret = -ENOSYS; + break; + + case SIOCGIWTXPOW: /* Get transmit power (dBm) */ + wlwarn("WARNING: SIOCGIWTXPOW not implemented\n"); + ret = -ENOSYS; + break; default: nerr("ERROR: Unrecognized IOCTL command: %d\n", command); - return -ENOTTY; /* Special return value for this case */ + ret = -ENOTTY; /* Special return value for this case */ + break; } - return OK; + return ret; } #endif