net: wireless: bcmdhd: remove unsed WEXT file.
Insun Song [Wed, 4 Jan 2017 00:21:01 +0000 (16:21 -0800)]
WEXT API was already obsoleted and should be removed.

Bug: 32124445
CVE-2017-0509 A-32124445
Bug 1880704

Change-Id: Iffb1c81afb9874120c64008c1072eebb8695c65f
Signed-off-by: Insun Song <insun.song@broadcom.com>
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/1310286
(cherry picked from commit 8c671aeb5f013590c58d7a5c7d4456e30fddcba3)
Reviewed-on: http://git-master/r/1330544
Reviewed-by: Manish Tuteja <mtuteja@nvidia.com>

drivers/net/wireless/bcmdhd/Kconfig
drivers/net/wireless/bcmdhd/dhd_common.c
drivers/net/wireless/bcmdhd/dhd_custom_gpio.c
drivers/net/wireless/bcmdhd/dhd_linux.c
drivers/net/wireless/bcmdhd/dhd_linux.h

index 51d79aa..2962524 100644 (file)
@@ -57,14 +57,6 @@ config BCMDHD_HW_OOB
        ---help---
          Use out of band interrupt for card interrupt and wake on wireless.
 
-config BCMDHD_WEXT
-       bool "Enable WEXT support"
-       depends on BCMDHD && CFG80211 = n
-       select WIRELESS_EXT
-       select WEXT_PRIV
-       help
-         Enables WEXT support
-
 config DHD_USE_STATIC_BUF
        bool "Enable memory preallocation"
        depends on BCMDHD
index d146d5a..a68ca74 100644 (file)
@@ -81,7 +81,6 @@ extern void htsf_update(struct dhd_info *dhd, void *data);
 int dhd_msg_level = DHD_ERROR_VAL;
 
 
-#include <wl_iw.h>
 #ifdef CONFIG_BCMDHD_CUSTOM_SYSFS_TEGRA
 #include "dhd_custom_sysfs_tegra.h"
 #include "dhd_custom_sysfs_tegra_stat.h"
@@ -2776,206 +2775,6 @@ wl_iw_parse_data_tlv(char** list_str, void *dst, int dst_size, const char token,
        return 1;
 }
 
-/*
- *  channel list parsing from cscan tlv list
-*/
-int
-wl_iw_parse_channel_list_tlv(char** list_str, uint16* channel_list,
-                             int channel_num, int *bytes_left)
-{
-       char* str;
-       int idx = 0;
-
-       if ((list_str == NULL) || (*list_str == NULL) ||(bytes_left == NULL) || (*bytes_left < 0)) {
-               DHD_ERROR(("%s error paramters\n", __FUNCTION__));
-               return -1;
-       }
-       str = *list_str;
-
-       while (*bytes_left > 0) {
-
-               if (str[0] != CSCAN_TLV_TYPE_CHANNEL_IE) {
-                       *list_str = str;
-                       DHD_TRACE(("End channel=%d left_parse=%d %d\n", idx, *bytes_left, str[0]));
-                       return idx;
-               }
-               /* Get proper CSCAN_TLV_TYPE_CHANNEL_IE */
-               *bytes_left -= 1;
-               str += 1;
-
-               if (str[0] == 0) {
-                       /* All channels */
-                       channel_list[idx] = 0x0;
-               }
-               else {
-                       channel_list[idx] = (uint16)str[0];
-                       DHD_TRACE(("%s channel=%d \n", __FUNCTION__,  channel_list[idx]));
-               }
-               *bytes_left -= 1;
-               str += 1;
-
-               if (idx++ > 255) {
-                       DHD_ERROR(("%s Too many channels \n", __FUNCTION__));
-                       return -1;
-               }
-       }
-
-       *list_str = str;
-       return idx;
-}
-
-/*
- *  SSIDs list parsing from cscan tlv list
- */
-int
-wl_iw_parse_ssid_list_tlv(char** list_str, wlc_ssid_t* ssid, int max, int *bytes_left)
-{
-       char* str;
-       int idx = 0;
-
-       if ((list_str == NULL) || (*list_str == NULL) || (*bytes_left < 0)) {
-               DHD_ERROR(("%s error paramters\n", __FUNCTION__));
-               return -1;
-       }
-       str = *list_str;
-       while (*bytes_left > 0) {
-
-               if (str[0] != CSCAN_TLV_TYPE_SSID_IE) {
-                       *list_str = str;
-                       DHD_TRACE(("nssid=%d left_parse=%d %d\n", idx, *bytes_left, str[0]));
-                       return idx;
-               }
-
-               /* Get proper CSCAN_TLV_TYPE_SSID_IE */
-               *bytes_left -= 1;
-               str += 1;
-
-               if (str[0] == 0) {
-                       /* Broadcast SSID */
-                       ssid[idx].SSID_len = 0;
-                       memset((char*)ssid[idx].SSID, 0x0, DOT11_MAX_SSID_LEN);
-                       *bytes_left -= 1;
-                       str += 1;
-
-                       DHD_TRACE(("BROADCAST SCAN  left=%d\n", *bytes_left));
-               }
-               else if (str[0] <= DOT11_MAX_SSID_LEN) {
-                       /* Get proper SSID size */
-                       ssid[idx].SSID_len = str[0];
-                       *bytes_left -= 1;
-                       str += 1;
-
-                       /* Get SSID */
-                       if (ssid[idx].SSID_len > *bytes_left) {
-                               DHD_ERROR(("%s out of memory range len=%d but left=%d\n",
-                               __FUNCTION__, ssid[idx].SSID_len, *bytes_left));
-                               return -1;
-                       }
-
-                       memcpy((char*)ssid[idx].SSID, str, ssid[idx].SSID_len);
-
-                       *bytes_left -= ssid[idx].SSID_len;
-                       str += ssid[idx].SSID_len;
-
-                       DHD_TRACE(("%s :size=%d left=%d\n",
-                               (char*)ssid[idx].SSID, ssid[idx].SSID_len, *bytes_left));
-               }
-               else {
-                       DHD_ERROR(("### SSID size more that %d\n", str[0]));
-                       return -1;
-               }
-
-               if (idx++ >  max) {
-                       DHD_ERROR(("%s number of SSIDs more that %d\n", __FUNCTION__, idx));
-                       return -1;
-               }
-       }
-
-       *list_str = str;
-       return idx;
-}
-
-/* Parse a comma-separated list from list_str into ssid array, starting
- * at index idx.  Max specifies size of the ssid array.  Parses ssids
- * and returns updated idx; if idx >= max not all fit, the excess have
- * not been copied.  Returns -1 on empty string, or on ssid too long.
- */
-int
-wl_iw_parse_ssid_list(char** list_str, wlc_ssid_t* ssid, int idx, int max)
-{
-       char* str, *ptr;
-
-       if ((list_str == NULL) || (*list_str == NULL))
-               return -1;
-
-       for (str = *list_str; str != NULL; str = ptr) {
-
-               /* check for next TAG */
-               if (!strncmp(str, GET_CHANNEL, strlen(GET_CHANNEL))) {
-                       *list_str        = str + strlen(GET_CHANNEL);
-                       return idx;
-               }
-
-               if ((ptr = strchr(str, ',')) != NULL) {
-                       *ptr++ = '\0';
-               }
-
-               if (strlen(str) > DOT11_MAX_SSID_LEN) {
-                       DHD_ERROR(("ssid <%s> exceeds %d\n", str, DOT11_MAX_SSID_LEN));
-                       return -1;
-               }
-
-               if (strlen(str) == 0)
-                       ssid[idx].SSID_len = 0;
-
-               if (idx < max) {
-                       bzero(ssid[idx].SSID, sizeof(ssid[idx].SSID));
-                       strncpy((char*)ssid[idx].SSID, str, sizeof(ssid[idx].SSID) - 1);
-                       ssid[idx].SSID_len = strlen(str);
-               }
-               idx++;
-       }
-       return idx;
-}
-
-/*
- * Parse channel list from iwpriv CSCAN
- */
-int
-wl_iw_parse_channel_list(char** list_str, uint16* channel_list, int channel_num)
-{
-       int num;
-       int val;
-       char* str;
-       char* endptr = NULL;
-
-       if ((list_str == NULL)||(*list_str == NULL))
-               return -1;
-
-       str = *list_str;
-       num = 0;
-       while (strncmp(str, GET_NPROBE, strlen(GET_NPROBE))) {
-               val = (int)strtoul(str, &endptr, 0);
-               if (endptr == str) {
-                       printf("could not parse channel number starting at"
-                               " substring \"%s\" in list:\n%s\n",
-                               str, *list_str);
-                       return -1;
-               }
-               str = endptr + strspn(endptr, " ,");
-
-               if (num == channel_num) {
-                       DHD_ERROR(("too many channels (more than %d) in channel list:\n%s\n",
-                               channel_num, *list_str));
-                       return -1;
-               }
-
-               channel_list[num++] = (uint16)val;
-       }
-       *list_str = str;
-       return num;
-}
-
 /* Parse EAPOL 4 way handshake messages */
 void dhd_dump_eapol_4way_message(char *dump_data, bool direction)
 {
index def231d..0bb9b34 100644 (file)
@@ -35,7 +35,6 @@
 #include <dhd_linux.h>
 
 #include <wlioctl.h>
-#include <wl_iw.h>
 
 #define WL_ERROR(x) printf x
 #define WL_TRACE(x)
@@ -145,6 +144,12 @@ dhd_custom_get_mac_address(void *adapter, unsigned char *buf)
 }
 #endif /* GET_CUSTOM_MAC_ENABLE */
 
+struct cntry_locales_custom {
+       char iso_abbrev[WLC_CNTRY_BUF_SZ];
+       char custom_locale[WLC_CNTRY_BUF_SZ];
+       int32 custom_locale_rev;
+};
+
 /* Customized Locale table : OPTIONAL feature */
 const struct cntry_locales_custom translate_custom_table[] = {
 /* Table should be filled out based on custom platform regulatory requirement */
index aeb95a5..ac2701e 100644 (file)
@@ -279,12 +279,6 @@ print_tainted()
 }
 #endif /* LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 15) */
 
-/* Linux wireless extension support */
-#if defined(WL_WIRELESS_EXT)
-#include <wl_iw.h>
-extern wl_iw_extra_params_t  g_wl_iw_params;
-#endif /* defined(WL_WIRELESS_EXT) */
-
 #if defined(CONFIG_HAS_EARLYSUSPEND) && defined(DHD_USE_EARLYSUSPEND)
 #include <linux/earlysuspend.h>
 #endif /* defined(CONFIG_HAS_EARLYSUSPEND) && defined(DHD_USE_EARLYSUSPEND) */
@@ -762,10 +756,6 @@ int dhd_monitor_init(void *dhd_pub);
 int dhd_monitor_uninit(void);
 
 
-#if defined(WL_WIRELESS_EXT)
-struct iw_statistics *dhd_get_wireless_stats(struct net_device *dev);
-#endif /* defined(WL_WIRELESS_EXT) */
-
 static void dhd_dpc(ulong data);
 /* forward decl */
 extern int dhd_wait_pend8021x(struct net_device *dev);
@@ -4180,17 +4170,6 @@ dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
                return -1;
        }
 
-#if defined(WL_WIRELESS_EXT)
-       /* linux wireless extensions */
-       if ((cmd >= SIOCIWFIRST) && (cmd <= SIOCIWLAST)) {
-               /* may recurse, do NOT lock */
-               ret = wl_iw_ioctl(net, ifr, cmd);
-               DHD_PERIM_UNLOCK(&dhd->pub);
-               DHD_OS_WAKE_UNLOCK(&dhd->pub);
-               return ret;
-       }
-#endif /* defined(WL_WIRELESS_EXT) */
-
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 4, 2)
        if (cmd == SIOCETHTOOL) {
                ret = dhd_ethtool(dhd, (void*)ifr->ifr_data);
@@ -7145,15 +7124,6 @@ dhd_register_if(dhd_pub_t *dhdp, int ifidx, bool need_rtnl_lock)
        net->ethtool_ops = &dhd_ethtool_ops;
 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) */
 
-#if defined(WL_WIRELESS_EXT)
-#if WIRELESS_EXT < 19
-       net->get_wireless_stats = dhd_get_wireless_stats;
-#endif /* WIRELESS_EXT < 19 */
-#if WIRELESS_EXT > 12
-       net->wireless_handlers = (struct iw_handler_def *)&wl_iw_handler_def;
-#endif /* WIRELESS_EXT > 12 */
-#endif /* defined(WL_WIRELESS_EXT) */
-
        dhd->pub.rxsz = DBUS_RX_BUFFER_SIZE_DHD(net);
 
        memcpy(net->dev_addr, temp_addr, ETHER_ADDR_LEN);
@@ -7314,13 +7284,6 @@ void dhd_detach(dhd_pub_t *dhdp)
        }
 #endif /* CONFIG_HAS_EARLYSUSPEND && DHD_USE_EARLYSUSPEND */
 
-#if defined(WL_WIRELESS_EXT)
-       if (dhd->dhd_state & DHD_ATTACH_STATE_WL_ATTACH) {
-               /* Detatch and unlink in the iw */
-               wl_iw_detach();
-       }
-#endif /* defined(WL_WIRELESS_EXT) */
-
        /* delete all interfaces, start with virtual  */
        if (dhd->dhd_state & DHD_ATTACH_STATE_ADD_IF) {
                int i = 1;
index 3e8080e..da677eb 100644 (file)
 #ifdef DHD_WMF
 #include <dhd_wmf_linux.h>
 #endif
-/* Linux wireless extension support */
-#if defined(WL_WIRELESS_EXT)
-#include <wl_iw.h>
-#endif /* defined(WL_WIRELESS_EXT) */
+
 #if defined(CONFIG_HAS_EARLYSUSPEND) && defined(DHD_USE_EARLYSUSPEND)
 #include <linux/earlysuspend.h>
 #endif /* defined(CONFIG_HAS_EARLYSUSPEND) && defined(DHD_USE_EARLYSUSPEND) */