aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/mwifiex/scan.c')
-rw-r--r--drivers/net/wireless/mwifiex/scan.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index 68d905d58606..31a529578805 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -1007,7 +1007,9 @@ mwifiex_scan_setup_scan_config(struct mwifiex_private *priv,
1007 ht_cap->header.type = cpu_to_le16(WLAN_EID_HT_CAPABILITY); 1007 ht_cap->header.type = cpu_to_le16(WLAN_EID_HT_CAPABILITY);
1008 ht_cap->header.len = 1008 ht_cap->header.len =
1009 cpu_to_le16(sizeof(struct ieee80211_ht_cap)); 1009 cpu_to_le16(sizeof(struct ieee80211_ht_cap));
1010 mwifiex_fill_cap_info(priv, ht_cap); 1010 radio_type =
1011 mwifiex_band_to_radio_type(priv->adapter->config_bands);
1012 mwifiex_fill_cap_info(priv, radio_type, ht_cap);
1011 tlv_pos += sizeof(struct mwifiex_ie_types_htcap); 1013 tlv_pos += sizeof(struct mwifiex_ie_types_htcap);
1012 } 1014 }
1013 1015
@@ -2988,32 +2990,28 @@ mwifiex_save_curr_bcn(struct mwifiex_private *priv)
2988 struct mwifiex_bssdescriptor *curr_bss = 2990 struct mwifiex_bssdescriptor *curr_bss =
2989 &priv->curr_bss_params.bss_descriptor; 2991 &priv->curr_bss_params.bss_descriptor;
2990 2992
2991 /* save the beacon buffer if it is not saved or updated */ 2993 if (!curr_bss->beacon_buf_size)
2992 if ((priv->curr_bcn_buf == NULL) || 2994 return;
2993 (priv->curr_bcn_size != curr_bss->beacon_buf_size) ||
2994 (memcmp(priv->curr_bcn_buf, curr_bss->beacon_buf,
2995 curr_bss->beacon_buf_size))) {
2996
2997 kfree(priv->curr_bcn_buf);
2998 priv->curr_bcn_buf = NULL;
2999 2995
2996 /* allocate beacon buffer at 1st time; or if it's size has changed */
2997 if (!priv->curr_bcn_buf ||
2998 priv->curr_bcn_size != curr_bss->beacon_buf_size) {
3000 priv->curr_bcn_size = curr_bss->beacon_buf_size; 2999 priv->curr_bcn_size = curr_bss->beacon_buf_size;
3001 if (!priv->curr_bcn_size)
3002 return;
3003 3000
3001 kfree(priv->curr_bcn_buf);
3004 priv->curr_bcn_buf = kzalloc(curr_bss->beacon_buf_size, 3002 priv->curr_bcn_buf = kzalloc(curr_bss->beacon_buf_size,
3005 GFP_KERNEL); 3003 GFP_KERNEL);
3006 if (!priv->curr_bcn_buf) { 3004 if (!priv->curr_bcn_buf) {
3007 dev_err(priv->adapter->dev, 3005 dev_err(priv->adapter->dev,
3008 "failed to alloc curr_bcn_buf\n"); 3006 "failed to alloc curr_bcn_buf\n");
3009 } else { 3007 return;
3010 memcpy(priv->curr_bcn_buf, curr_bss->beacon_buf,
3011 curr_bss->beacon_buf_size);
3012 dev_dbg(priv->adapter->dev,
3013 "info: current beacon saved %d\n",
3014 priv->curr_bcn_size);
3015 } 3008 }
3016 } 3009 }
3010
3011 memcpy(priv->curr_bcn_buf, curr_bss->beacon_buf,
3012 curr_bss->beacon_buf_size);
3013 dev_dbg(priv->adapter->dev, "info: current beacon saved %d\n",
3014 priv->curr_bcn_size);
3017} 3015}
3018 3016
3019/* 3017/*