DivestOS/Patches/Linux_CVEs/CVE-2017-0789/0.patch

662 lines
24 KiB
Diff
Raw Normal View History

From 58168423faa39f5062047eb1d16d294902f0f48b Mon Sep 17 00:00:00 2001
From: Sudhir Kohalli <sudhir.kohalli@broadcom.com>
Date: Thu, 22 Jun 2017 11:48:53 -0700
Subject: net: wireless: bcmdhd: Remove "dhd_handle_swc_evt" from dhd.
Remove SWC(siginificant wifi change) from the host. Since current
feature is no longer being used. If needed will get the feature
back. Due to this there will not any heap overflow in
"dhd_handle_swc_evt" will be observed.
Signed-off-by: Sudhir Kohalli <sudhir.kohalli@broadcom.com>
Bug: 37685267
Change-Id: Ib03a39626223e27079f2b3f91564eb21025e57cf
---
drivers/net/wireless/bcmdhd/bcmevent.c | 1 -
drivers/net/wireless/bcmdhd/dhd_common.c | 1 -
drivers/net/wireless/bcmdhd/dhd_linux.c | 9 -
drivers/net/wireless/bcmdhd/dhd_pno.c | 240 +--------------------
drivers/net/wireless/bcmdhd/dhd_pno.h | 45 ++--
.../net/wireless/bcmdhd/include/proto/bcmevent.h | 2 +-
drivers/net/wireless/bcmdhd/include/wlioctl.h | 6 -
drivers/net/wireless/bcmdhd/wl_cfg80211.c | 9 -
drivers/net/wireless/bcmdhd/wl_cfgvendor.c | 108 ----------
9 files changed, 22 insertions(+), 399 deletions(-)
diff --git a/drivers/net/wireless/bcmdhd/bcmevent.c b/drivers/net/wireless/bcmdhd/bcmevent.c
index 7ed9739..30e10d9 100644
--- a/drivers/net/wireless/bcmdhd/bcmevent.c
+++ b/drivers/net/wireless/bcmdhd/bcmevent.c
@@ -157,7 +157,6 @@ static const bcmevent_name_str_t bcmevent_names[] = {
BCMEVENT_NAME(WLC_E_TXFAIL_THRESH),
#ifdef GSCAN_SUPPORT
BCMEVENT_NAME(WLC_E_PFN_GSCAN_FULL_RESULT),
- BCMEVENT_NAME(WLC_E_PFN_SWC),
#endif /* GSCAN_SUPPORT */
#ifdef WLBSSLOAD_REPORT
BCMEVENT_NAME(WLC_E_BSS_LOAD),
diff --git a/drivers/net/wireless/bcmdhd/dhd_common.c b/drivers/net/wireless/bcmdhd/dhd_common.c
index 1fbb5c4..d3f04a7 100644
--- a/drivers/net/wireless/bcmdhd/dhd_common.c
+++ b/drivers/net/wireless/bcmdhd/dhd_common.c
@@ -1325,7 +1325,6 @@ wl_show_host_event(dhd_pub_t *dhd_pub, wl_event_msg_t *event, void *event_data,
case WLC_E_PFN_SCAN_NONE:
case WLC_E_PFN_SCAN_ALLGONE:
case WLC_E_PFN_GSCAN_FULL_RESULT:
- case WLC_E_PFN_SWC:
case WLC_E_PFN_SSID_EXT:
DHD_EVENT(("PNOEVENT: %s\n", event_name));
break;
diff --git a/drivers/net/wireless/bcmdhd/dhd_linux.c b/drivers/net/wireless/bcmdhd/dhd_linux.c
index abc4331..101b03a 100644
--- a/drivers/net/wireless/bcmdhd/dhd_linux.c
+++ b/drivers/net/wireless/bcmdhd/dhd_linux.c
@@ -6066,7 +6066,6 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
#ifdef GSCAN_SUPPORT
setbit(eventmask_msg->mask, WLC_E_PFN_GSCAN_FULL_RESULT);
setbit(eventmask_msg->mask, WLC_E_PFN_SCAN_COMPLETE);
- setbit(eventmask_msg->mask, WLC_E_PFN_SWC);
setbit(eventmask_msg->mask, WLC_E_PFN_SSID_EXT);
setbit(eventmask_msg->mask, WLC_E_ROAM_EXP_EVENT);
#endif /* GSCAN_SUPPORT */
@@ -8401,14 +8400,6 @@ int dhd_dev_pno_enable_full_scan_result(struct net_device *dev, bool real_time_f
return (dhd_pno_enable_full_scan_result(&dhd->pub, real_time_flag));
}
-/* Linux wrapper to call common dhd_handle_swc_evt */
-void * dhd_dev_swc_scan_event(struct net_device *dev, const void *data, int *send_evt_bytes)
-{
- dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
-
- return (dhd_handle_swc_evt(&dhd->pub, data, send_evt_bytes));
-}
-
/* Linux wrapper to call common dhd_handle_hotlist_scan_evt */
void * dhd_dev_hotlist_scan_event(struct net_device *dev,
const void *data, int *send_evt_bytes, hotlist_type_t type)
diff --git a/drivers/net/wireless/bcmdhd/dhd_pno.c b/drivers/net/wireless/bcmdhd/dhd_pno.c
index 3103f89..8ebdf53 100644
--- a/drivers/net/wireless/bcmdhd/dhd_pno.c
+++ b/drivers/net/wireless/bcmdhd/dhd_pno.c
@@ -1028,34 +1028,6 @@ exit:
return err;
}
-#ifdef GSCAN_SUPPORT
-static int
-_dhd_pno_add_significant_bssid(dhd_pub_t *dhd,
- wl_pfn_significant_bssid_t *p_pfn_significant_bssid, int nbssid)
-{
- int err = BCME_OK;
- NULL_CHECK(dhd, "dhd is NULL", err);
-
- if (!nbssid) {
- err = BCME_ERROR;
- goto exit;
- }
-
- NULL_CHECK(p_pfn_significant_bssid, "bssid list is NULL", err);
-
- err = dhd_iovar(dhd, 0, "pfn_add_swc_bssid",
- (char *)p_pfn_significant_bssid,
- sizeof(wl_pfn_significant_bssid_t) * nbssid, NULL, 0,
- TRUE);
- if (err < 0) {
- DHD_ERROR(("%s : failed to execute pfn_significant_bssid %d\n", __FUNCTION__, err));
- goto exit;
- }
-exit:
- return err;
-}
-#endif /* GSCAN_SUPPORT */
-
int
dhd_pno_stop_for_ssid(dhd_pub_t *dhd)
{
@@ -1654,19 +1626,6 @@ static void dhd_pno_reset_cfg_gscan(dhd_pno_params_t *_params,
_params->params_gscan.nbssid_hotlist = 0;
DHD_PNO(("Flush Hotlist Config\n"));
}
- if (flags & GSCAN_FLUSH_SIGNIFICANT_CFG) {
- dhd_pno_significant_bssid_t *iter, *next;
-
- if (_params->params_gscan.nbssid_significant_change > 0) {
- list_for_each_entry_safe(iter, next,
- &_params->params_gscan.significant_bssid_list, list) {
- list_del(&iter->list);
- kfree(iter);
- }
- }
- _params->params_gscan.nbssid_significant_change = 0;
- DHD_PNO(("Flush Significant Change Config\n"));
- }
if (flags & GSCAN_FLUSH_EPNO_CFG) {
dhd_pno_ssid_t *iter, *next;
dhd_epno_ssid_cfg_t *epno_cfg = &_params->params_gscan.epno_cfg;
@@ -1808,8 +1767,10 @@ void * dhd_pno_get_gscan(dhd_pub_t *dhd, dhd_pno_gscan_cmd_cfg_t type,
ptr->max_ap_cache_per_scan = GSCAN_MAX_AP_CACHE_PER_SCAN;
ptr->max_rssi_sample_size = PFN_SWC_RSSI_WINDOW_MAX;
ptr->max_scan_reporting_threshold = 100;
- ptr->max_hotlist_aps = PFN_HOTLIST_MAX_NUM_APS;
- ptr->max_significant_wifi_change_aps = PFN_SWC_MAX_NUM_APS;
+ ptr->max_hotlist_bssids = PFN_HOTLIST_MAX_NUM_APS;
+ ptr->max_hotlist_ssids = 0;
+ ptr->max_significant_wifi_change_aps = 0;
+ ptr->max_bssid_history_entries = 0;
ptr->max_epno_ssid_crc32 = MAX_EPNO_SSID_NUM;
ptr->max_epno_hidden_ssid = MAX_EPNO_HIDDEN_SSID;
ptr->max_white_list_ssid = MAX_WHITELIST_SSID;
@@ -1943,10 +1904,10 @@ int dhd_pno_set_cfg_gscan(dhd_pub_t *dhd, dhd_pno_gscan_cmd_cfg_t type,
INIT_LIST_HEAD(&_params->params_gscan.hotlist_bssid_list);
if ((_params->params_gscan.nbssid_hotlist +
- ptr->nbssid) > PFN_SWC_MAX_NUM_APS) {
+ ptr->nbssid) > PFN_SWC_MAX_NUM_APS) {
DHD_ERROR(("Excessive number of hotlist APs programmed %d\n",
- (_params->params_gscan.nbssid_hotlist +
- ptr->nbssid)));
+ (_params->params_gscan.nbssid_hotlist +
+ ptr->nbssid)));
err = BCME_RANGE;
goto exit;
}
@@ -1972,61 +1933,6 @@ int dhd_pno_set_cfg_gscan(dhd_pub_t *dhd, dhd_pno_gscan_cmd_cfg_t type,
_params->params_gscan.lost_ap_window = ptr->lost_ap_window;
}
break;
- case DHD_PNO_SIGNIFICANT_SCAN_CFG_ID:
- {
- gscan_swc_params_t *ptr = (gscan_swc_params_t *)buf;
- dhd_pno_significant_bssid_t *_pno_significant_change_bssid;
- wl_pfn_significant_bssid_t *significant_bssid_ptr;
-
- if (flush) {
- dhd_pno_reset_cfg_gscan(_params, _pno_state,
- GSCAN_FLUSH_SIGNIFICANT_CFG);
- }
-
- if (!ptr->nbssid)
- break;
-
- if (!_params->params_gscan.nbssid_significant_change)
- INIT_LIST_HEAD(&_params->params_gscan.significant_bssid_list);
-
- if ((_params->params_gscan.nbssid_significant_change +
- ptr->nbssid) > PFN_SWC_MAX_NUM_APS) {
- DHD_ERROR(("Excessive number of SWC APs programmed %d\n",
- (_params->params_gscan.nbssid_significant_change +
- ptr->nbssid)));
- err = BCME_RANGE;
- goto exit;
- }
-
- for (i = 0, significant_bssid_ptr = ptr->bssid_elem_list;
- i < ptr->nbssid; i++, significant_bssid_ptr++) {
- _pno_significant_change_bssid =
- kzalloc(sizeof(dhd_pno_significant_bssid_t),
- GFP_KERNEL);
-
- if (!_pno_significant_change_bssid) {
- DHD_ERROR(("SWC bssidptr is NULL, cannot kalloc %zd bytes",
- sizeof(dhd_pno_significant_bssid_t)));
- err = BCME_NOMEM;
- goto exit;
- }
- memcpy(&_pno_significant_change_bssid->BSSID,
- &significant_bssid_ptr->macaddr, ETHER_ADDR_LEN);
- _pno_significant_change_bssid->rssi_low_threshold =
- significant_bssid_ptr->rssi_low_threshold;
- _pno_significant_change_bssid->rssi_high_threshold =
- significant_bssid_ptr->rssi_high_threshold;
- list_add_tail(&_pno_significant_change_bssid->list,
- &_params->params_gscan.significant_bssid_list);
- }
-
- _params->params_gscan.swc_nbssid_threshold = ptr->swc_threshold;
- _params->params_gscan.swc_rssi_window_size = ptr->rssi_window;
- _params->params_gscan.lost_ap_window = ptr->lost_ap_window;
- _params->params_gscan.nbssid_significant_change += ptr->nbssid;
-
- }
- break;
case DHD_PNO_SCAN_CFG_ID:
{
int i, k;
@@ -2145,7 +2051,6 @@ dhd_pno_set_for_gscan(dhd_pub_t *dhd, struct dhd_pno_gscan_params *gscan_params)
dhd_pno_status_info_t *_pno_state = PNO_GET_PNOSTATE(dhd);
wl_pfn_gscan_ch_bucket_cfg_t *ch_bucket = NULL;
wl_pfn_gscan_cfg_t *pfn_gscan_cfg_t = NULL;
- wl_pfn_significant_bssid_t *p_pfn_significant_bssid = NULL;
wl_pfn_bssid_t *p_pfn_bssid = NULL;
dhd_pno_params_t *params_legacy;
dhd_pno_params_t *_params;
@@ -2219,7 +2124,8 @@ dhd_pno_set_for_gscan(dhd_pub_t *dhd, struct dhd_pno_gscan_params *gscan_params)
gscan_param_size = sizeof(wl_pfn_gscan_cfg_t) +
(num_buckets_to_fw - 1) * sizeof(wl_pfn_gscan_ch_bucket_cfg_t);
- pfn_gscan_cfg_t = (wl_pfn_gscan_cfg_t *) MALLOC(dhd->osh, gscan_param_size);
+ pfn_gscan_cfg_t = (wl_pfn_gscan_cfg_t *)
+ MALLOCZ(dhd->osh, gscan_param_size);
if (!pfn_gscan_cfg_t) {
DHD_ERROR(("%s: failed to malloc memory of size %d\n",
@@ -2234,16 +2140,6 @@ dhd_pno_set_for_gscan(dhd_pub_t *dhd, struct dhd_pno_gscan_params *gscan_params)
else
pfn_gscan_cfg_t->buffer_threshold = GSCAN_BATCH_NO_THR_SET;
- if (gscan_params->nbssid_significant_change) {
- pfn_gscan_cfg_t->swc_nbssid_threshold = gscan_params->swc_nbssid_threshold;
- pfn_gscan_cfg_t->swc_rssi_window_size = gscan_params->swc_rssi_window_size;
- pfn_gscan_cfg_t->lost_ap_window = gscan_params->lost_ap_window;
- } else {
- pfn_gscan_cfg_t->swc_nbssid_threshold = 0;
- pfn_gscan_cfg_t->swc_rssi_window_size = 0;
- pfn_gscan_cfg_t->lost_ap_window = 0;
- }
-
pfn_gscan_cfg_t->flags =
(gscan_params->send_all_results_flag & GSCAN_SEND_ALL_RESULTS_MASK);
pfn_gscan_cfg_t->count_of_channel_buckets = num_buckets_to_fw;
@@ -2277,38 +2173,6 @@ dhd_pno_set_for_gscan(dhd_pub_t *dhd, struct dhd_pno_gscan_params *gscan_params)
__FUNCTION__, err));
goto exit;
}
- if (gscan_params->nbssid_significant_change) {
- dhd_pno_significant_bssid_t *iter, *next;
-
- p_pfn_significant_bssid = kzalloc(sizeof(wl_pfn_significant_bssid_t) *
- gscan_params->nbssid_significant_change, GFP_KERNEL);
- if (p_pfn_significant_bssid == NULL) {
- DHD_ERROR(("%s : failed to allocate memory %zd\n",
- __FUNCTION__,
- sizeof(wl_pfn_significant_bssid_t) *
- gscan_params->nbssid_significant_change));
- err = BCME_NOMEM;
- goto exit;
- }
- i = 0;
- /* convert dhd_pno_significant_bssid_t to wl_pfn_significant_bssid_t */
- list_for_each_entry_safe(iter, next, &gscan_params->significant_bssid_list, list) {
- p_pfn_significant_bssid[i].rssi_low_threshold = iter->rssi_low_threshold;
- p_pfn_significant_bssid[i].rssi_high_threshold = iter->rssi_high_threshold;
- memcpy(&p_pfn_significant_bssid[i].macaddr, &iter->BSSID, ETHER_ADDR_LEN);
- i++;
- }
-
- DHD_PNO(("nbssid_significant_change %d \n",
- gscan_params->nbssid_significant_change));
- err = _dhd_pno_add_significant_bssid(dhd, p_pfn_significant_bssid,
- gscan_params->nbssid_significant_change);
- if (err < 0) {
- DHD_ERROR(("%s : failed to call _dhd_pno_add_significant_bssid(err :%d)\n",
- __FUNCTION__, err));
- goto exit;
- }
- }
/* Reprogram ePNO cfg from dhd cache if FW has been flushed */
if (fw_flushed) {
dhd_pno_set_epno(dhd);
@@ -2362,7 +2226,6 @@ exit:
_pno_state->pno_mode &= ~DHD_PNO_GSCAN_MODE;
}
}
- kfree(p_pfn_significant_bssid);
kfree(p_pfn_bssid);
if (pfn_gscan_cfg_t)
MFREE(dhd->osh, pfn_gscan_cfg_t, gscan_param_size);
@@ -3581,91 +3444,6 @@ int dhd_retreive_batch_scan_results(dhd_pub_t *dhd)
return err;
}
-/* Handle Significant WiFi Change (SWC) event from FW
- * Send event to HAL when all results arrive from FW
- */
-void * dhd_handle_swc_evt(dhd_pub_t *dhd, const void *event_data, int *send_evt_bytes)
-{
- void *ptr = NULL;
- dhd_pno_status_info_t *_pno_state = PNO_GET_PNOSTATE(dhd);
- struct dhd_pno_gscan_params *gscan_params;
- struct dhd_pno_swc_evt_param *params;
- wl_pfn_swc_results_t *results = (wl_pfn_swc_results_t *)event_data;
- wl_pfn_significant_net_t *change_array;
- int i;
-
- gscan_params = &(_pno_state->pno_params_arr[INDEX_OF_GSCAN_PARAMS].params_gscan);
- params = &(gscan_params->param_significant);
-
- if (!results->total_count) {
- *send_evt_bytes = 0;
- return ptr;
- }
-
- if (!params->results_rxed_so_far) {
- if (!params->change_array) {
- params->change_array = (wl_pfn_significant_net_t *)
- kmalloc(sizeof(wl_pfn_significant_net_t) * results->total_count,
- GFP_KERNEL);
-
- if (!params->change_array) {
- DHD_ERROR(("%s Cannot Malloc %zd bytes!!\n", __FUNCTION__,
- sizeof(wl_pfn_significant_net_t) * results->total_count));
- *send_evt_bytes = 0;
- return ptr;
- }
- } else {
- DHD_ERROR(("RX'ed WLC_E_PFN_SWC evt from FW, previous evt not complete!!"));
- *send_evt_bytes = 0;
- return ptr;
- }
-
- }
-
- DHD_PNO(("%s: pkt_count %d total_count %d\n", __FUNCTION__,
- results->pkt_count, results->total_count));
-
- for (i = 0; i < results->pkt_count; i++) {
- DHD_PNO(("\t %02x:%02x:%02x:%02x:%02x:%02x\n",
- results->list[i].BSSID.octet[0],
- results->list[i].BSSID.octet[1],
- results->list[i].BSSID.octet[2],
- results->list[i].BSSID.octet[3],
- results->list[i].BSSID.octet[4],
- results->list[i].BSSID.octet[5]));
- }
-
- change_array = &params->change_array[params->results_rxed_so_far];
- if ((params->results_rxed_so_far + results->pkt_count) >
- results->total_count) {
- DHD_ERROR(("Error: Invalid data reset the counters!!\n"));
- *send_evt_bytes = 0;
- kfree(params->change_array);
- params->change_array = NULL;
- return ptr;
- }
-
- memcpy(change_array, results->list,
- sizeof(wl_pfn_significant_net_t) * results->pkt_count);
- params->results_rxed_so_far += results->pkt_count;
-
- if (params->results_rxed_so_far == results->total_count) {
- params->results_rxed_so_far = 0;
- *send_evt_bytes = sizeof(wl_pfn_significant_net_t) * results->total_count;
- /* Pack up change buffer to send up and reset
- * results_rxed_so_far, after its done.
- */
- ptr = (void *) params->change_array;
- /* expecting the callee to free this mem chunk */
- params->change_array = NULL;
- }
- else {
- *send_evt_bytes = 0;
- }
-
- return ptr;
-}
-
void dhd_gscan_hotlist_cache_cleanup(dhd_pub_t *dhd, hotlist_type_t type)
{
dhd_pno_status_info_t *_pno_state = PNO_GET_PNOSTATE(dhd);
diff --git a/drivers/net/wireless/bcmdhd/dhd_pno.h b/drivers/net/wireless/bcmdhd/dhd_pno.h
index 3398752..9a348f9 100644
--- a/drivers/net/wireless/bcmdhd/dhd_pno.h
+++ b/drivers/net/wireless/bcmdhd/dhd_pno.h
@@ -359,16 +359,18 @@ typedef struct {
} wifi_passpoint_network;
typedef struct dhd_pno_gscan_capabilities {
- int max_scan_cache_size;
- int max_scan_buckets;
- int max_ap_cache_per_scan;
- int max_rssi_sample_size;
- int max_scan_reporting_threshold;
- int max_hotlist_aps;
- int max_significant_wifi_change_aps;
- int max_epno_ssid_crc32;
- int max_epno_hidden_ssid;
- int max_white_list_ssid;
+ int max_scan_cache_size;
+ int max_scan_buckets;
+ int max_ap_cache_per_scan;
+ int max_rssi_sample_size;
+ int max_scan_reporting_threshold;
+ int max_hotlist_bssids;
+ int max_hotlist_ssids;
+ int max_significant_wifi_change_aps;
+ int max_bssid_history_entries;
+ int max_epno_ssid_crc32;
+ int max_epno_hidden_ssid;
+ int max_white_list_ssid;
} dhd_pno_gscan_capabilities_t;
typedef struct dhd_epno_ssid_cfg {
@@ -426,26 +428,6 @@ typedef struct gscan_hotlist_scan_params {
struct bssid_t bssid[1]; /* n bssids to follow */
} gscan_hotlist_scan_params_t;
-/* SWC (Significant WiFi Change) params */
-typedef struct gscan_swc_params {
- /* Rssi averaging window size */
- uint8 rssi_window;
- /* Number of scans that the AP has to be absent before
- * being declared LOST
- */
- uint8 lost_ap_window;
- /* if x Aps have a significant change generate an event. */
- uint8 swc_threshold;
- uint8 nbssid;
- wl_pfn_significant_bssid_t bssid_elem_list[1];
-} gscan_swc_params_t;
-
-typedef struct dhd_pno_significant_bssid {
- struct ether_addr BSSID;
- int8 rssi_low_threshold;
- int8 rssi_high_threshold;
- struct list_head list;
-} dhd_pno_significant_bssid_t;
#endif /* GSCAN_SUPPORT */
typedef union dhd_pno_params {
struct dhd_pno_legacy_params params_legacy;
@@ -506,8 +488,6 @@ int dhd_dev_pno_lock_access_batch_results(struct net_device *dev);
void dhd_dev_pno_unlock_access_batch_results(struct net_device *dev);
extern int dhd_dev_pno_run_gscan(struct net_device *dev, bool run, bool flush);
extern int dhd_dev_pno_enable_full_scan_result(struct net_device *dev, bool real_time);
-extern void * dhd_dev_swc_scan_event(struct net_device *dev, const void *data,
- int *send_evt_bytes);
int dhd_retreive_batch_scan_results(dhd_pub_t *dhd);
extern void * dhd_dev_hotlist_scan_event(struct net_device *dev,
const void *data, int *send_evt_bytes, hotlist_type_t type);
@@ -560,7 +540,6 @@ extern int dhd_pno_initiate_gscan_request(dhd_pub_t *dhd, bool run, bool flush);
extern int dhd_pno_enable_full_scan_result(dhd_pub_t *dhd, bool real_time_flag);
extern int dhd_pno_cfg_gscan(dhd_pub_t *dhd, dhd_pno_gscan_cmd_cfg_t type, void *buf);
extern int dhd_dev_retrieve_batch_scan(struct net_device *dev);
-extern void *dhd_handle_swc_evt(dhd_pub_t *dhd, const void *event_data, int *send_evt_bytes);
extern void *dhd_handle_hotlist_scan_evt(dhd_pub_t *dhd, const void *event_data,
int *send_evt_bytes, hotlist_type_t type);
extern void *
diff --git a/drivers/net/wireless/bcmdhd/include/proto/bcmevent.h b/drivers/net/wireless/bcmdhd/include/proto/bcmevent.h
index 098da15..d6f7cd4 100644
--- a/drivers/net/wireless/bcmdhd/include/proto/bcmevent.h
+++ b/drivers/net/wireless/bcmdhd/include/proto/bcmevent.h
@@ -236,7 +236,7 @@ typedef union bcm_event_msg_u {
#define WLC_E_FBT_AUTH_REQ_IND 132 /* FBT Authentication Request Indication */
#define WLC_E_RSSI_LQM 133 /* Enhancement addition for WLC_E_RSSI */
#define WLC_E_PFN_GSCAN_FULL_RESULT 134 /* Full probe/beacon (IEs etc) results */
-#define WLC_E_PFN_SWC 135 /* Significant change in rssi of bssids being tracked */
+/* 135 was legacy entry for WLC_E_PFN_SWC can be reused */
#define WLC_E_PFN_SCAN_COMPLETE 138 /* PFN completed scan of network list */
#define WLC_E_RMC_EVENT 139 /* RMC event */
#define WLC_E_PFN_SSID_EXT 142 /* SSID EXT event */
diff --git a/drivers/net/wireless/bcmdhd/include/wlioctl.h b/drivers/net/wireless/bcmdhd/include/wlioctl.h
index 808a0bf..b89c4be 100644
--- a/drivers/net/wireless/bcmdhd/include/wlioctl.h
+++ b/drivers/net/wireless/bcmdhd/include/wlioctl.h
@@ -2705,12 +2705,6 @@ typedef struct wl_pfn_bssid {
uint16 flags;
} wl_pfn_bssid_t;
-typedef struct wl_pfn_significant_bssid {
- struct ether_addr macaddr;
- int8 rssi_low_threshold;
- int8 rssi_high_threshold;
-} wl_pfn_significant_bssid_t;
-
#define WL_PFN_SUPPRESSFOUND_MASK 0x08
#define WL_PFN_SUPPRESSLOST_MASK 0x10
#define WL_PFN_RSSI_MASK 0xff00
diff --git a/drivers/net/wireless/bcmdhd/wl_cfg80211.c b/drivers/net/wireless/bcmdhd/wl_cfg80211.c
index 1d1e2a8..e7ababd 100644
--- a/drivers/net/wireless/bcmdhd/wl_cfg80211.c
+++ b/drivers/net/wireless/bcmdhd/wl_cfg80211.c
@@ -9397,14 +9397,6 @@ wl_notify_gscan_event(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev,
u32 len = ntoh32(e->datalen);
switch (event) {
- case WLC_E_PFN_SWC:
- ptr = dhd_dev_swc_scan_event(ndev, data, &send_evt_bytes);
- if (send_evt_bytes) {
- wl_cfgvendor_send_async_event(wiphy, ndev,
- GOOGLE_GSCAN_SIGNIFICANT_EVENT, ptr, send_evt_bytes);
- kfree(ptr);
- }
- break;
case WLC_E_PFN_BEST_BATCHING:
err = dhd_dev_retrieve_batch_scan(ndev);
if (err < 0) {
@@ -10094,7 +10086,6 @@ static void wl_init_event_handler(struct bcm_cfg80211 *cfg)
cfg->evt_handler[WLC_E_PFN_BEST_BATCHING] = wl_notify_gscan_event;
cfg->evt_handler[WLC_E_PFN_SCAN_COMPLETE] = wl_notify_gscan_event;
cfg->evt_handler[WLC_E_PFN_GSCAN_FULL_RESULT] = wl_notify_gscan_event;
- cfg->evt_handler[WLC_E_PFN_SWC] = wl_notify_gscan_event;
cfg->evt_handler[WLC_E_PFN_BSSID_NET_FOUND] = wl_notify_gscan_event;
cfg->evt_handler[WLC_E_PFN_BSSID_NET_LOST] = wl_notify_gscan_event;
cfg->evt_handler[WLC_E_PFN_SSID_EXT] = wl_notify_gscan_event;
diff --git a/drivers/net/wireless/bcmdhd/wl_cfgvendor.c b/drivers/net/wireless/bcmdhd/wl_cfgvendor.c
index 4e5fee0..140a20d 100644
--- a/drivers/net/wireless/bcmdhd/wl_cfgvendor.c
+++ b/drivers/net/wireless/bcmdhd/wl_cfgvendor.c
@@ -1158,106 +1158,6 @@ static int wl_cfgvendor_set_batch_scan_cfg(struct wiphy *wiphy,
return err;
}
-static int wl_cfgvendor_significant_change_cfg(struct wiphy *wiphy,
- struct wireless_dev *wdev, const void *data, int len)
-{
- int err = 0;
- struct bcm_cfg80211 *cfg = wiphy_priv(wiphy);
- gscan_swc_params_t *significant_params;
- int tmp, tmp1, tmp2, type, j = 0;
- const struct nlattr *outer, *inner, *iter;
- bool flush = FALSE;
- wl_pfn_significant_bssid_t *pbssid;
- uint16 num_bssid = 0;
- uint16 max_buf_size = sizeof(gscan_swc_params_t) +
- sizeof(wl_pfn_significant_bssid_t) * (PFN_SWC_MAX_NUM_APS - 1);
-
- significant_params = kzalloc(max_buf_size, GFP_KERNEL);
-
- if (!significant_params) {
- WL_ERR(("Cannot Malloc mem size:%d\n", len));
- return BCME_NOMEM;
- }
-
-
- nla_for_each_attr(iter, data, len, tmp2) {
- type = nla_type(iter);
-
- switch (type) {
- case GSCAN_ATTRIBUTE_SIGNIFICANT_CHANGE_FLUSH:
- flush = (bool) nla_get_u8(iter);
- break;
- case GSCAN_ATTRIBUTE_RSSI_SAMPLE_SIZE:
- significant_params->rssi_window = nla_get_u16(iter);
- break;
- case GSCAN_ATTRIBUTE_LOST_AP_SAMPLE_SIZE:
- significant_params->lost_ap_window = nla_get_u16(iter);
- break;
- case GSCAN_ATTRIBUTE_MIN_BREACHING:
- significant_params->swc_threshold = nla_get_u16(iter);
- break;
- case GSCAN_ATTRIBUTE_NUM_BSSID:
- num_bssid = nla_get_u16(iter);
- if (num_bssid > PFN_SWC_MAX_NUM_APS) {
- WL_ERR(("ovar max SWC bssids:%d\n",
- num_bssid));
- err = BCME_BADARG;
- goto exit;
- }
- break;
- case GSCAN_ATTRIBUTE_SIGNIFICANT_CHANGE_BSSIDS:
- if (num_bssid == 0) {
- WL_ERR(("num_bssid : 0\n"));
- err = BCME_BADARG;
- goto exit;
- }
- pbssid = significant_params->bssid_elem_list;
- nla_for_each_nested(outer, iter, tmp) {
- if (j >= num_bssid) {
- j++;
- break;
- }
- nla_for_each_nested(inner, outer, tmp1) {
- switch (nla_type(inner)) {
- case GSCAN_ATTRIBUTE_BSSID:
- memcpy(&(pbssid[j].macaddr),
- nla_data(inner),
- ETHER_ADDR_LEN);
- break;
- case GSCAN_ATTRIBUTE_RSSI_HIGH:
- pbssid[j].rssi_high_threshold =
- (int8) nla_get_u8(inner);
- break;
- case GSCAN_ATTRIBUTE_RSSI_LOW:
- pbssid[j].rssi_low_threshold =
- (int8) nla_get_u8(inner);
- break;
- }
- }
- j++;
- }
- break;
- }
- }
- if (j != num_bssid) {
- WL_ERR(("swc bssids count:%d not matched to num_bssid:%d\n",
- j, num_bssid));
- err = BCME_BADARG;
- goto exit;
- }
- significant_params->nbssid = j;
-
- if (dhd_dev_pno_set_cfg_gscan(bcmcfg_to_prmry_ndev(cfg),
- DHD_PNO_SIGNIFICANT_SCAN_CFG_ID, significant_params, flush) < 0) {
- WL_ERR(("Could not set GSCAN significant cfg\n"));
- err = -EINVAL;
- goto exit;
- }
-exit:
- kfree(significant_params);
- return err;
-}
-
static int wl_cfgvendor_enable_lazy_roam(struct wiphy *wiphy,
struct wireless_dev *wdev, const void *data, int len)
{
@@ -3013,14 +2913,6 @@ static const struct wiphy_vendor_command wl_vendor_cmds [] = {
{
{
.vendor_id = OUI_GOOGLE,
- .subcmd = GSCAN_SUBCMD_SET_SIGNIFICANT_CHANGE_CONFIG
- },
- .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
- .doit = wl_cfgvendor_significant_change_cfg
- },
- {
- {
- .vendor_id = OUI_GOOGLE,
.subcmd = GSCAN_SUBCMD_GET_SCAN_RESULTS
},
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
--
cgit v1.1