Commit b8af4466 authored by Arend Van Spriel's avatar Arend Van Spriel Committed by Greg Kroah-Hartman
Browse files

brcmfmac: setup passive scan if requested by user-space

commit 35f62727

 upstream.

The driver was not properly configuring firmware with regard to the
type of scan. It always performed an active scan even when user-space
was requesting for passive scan, ie. the scan request was done without
any SSIDs specified.
Reported-by: default avatarHuang, Jiangyang <Jiangyang.Huang@itron.com>
Reviewed-by: default avatarHante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: default avatarFranky Lin <franky.lin@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ee5bd0e4
...@@ -876,7 +876,7 @@ static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg, ...@@ -876,7 +876,7 @@ static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg,
eth_broadcast_addr(params_le->bssid); eth_broadcast_addr(params_le->bssid);
params_le->bss_type = DOT11_BSSTYPE_ANY; params_le->bss_type = DOT11_BSSTYPE_ANY;
params_le->scan_type = 0; params_le->scan_type = BRCMF_SCANTYPE_ACTIVE;
params_le->channel_num = 0; params_le->channel_num = 0;
params_le->nprobes = cpu_to_le32(-1); params_le->nprobes = cpu_to_le32(-1);
params_le->active_time = cpu_to_le32(-1); params_le->active_time = cpu_to_le32(-1);
...@@ -884,12 +884,9 @@ static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg, ...@@ -884,12 +884,9 @@ static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg,
params_le->home_time = cpu_to_le32(-1); params_le->home_time = cpu_to_le32(-1);
memset(&params_le->ssid_le, 0, sizeof(params_le->ssid_le)); memset(&params_le->ssid_le, 0, sizeof(params_le->ssid_le));
/* if request is null exit so it will be all channel broadcast scan */
if (!request)
return;
n_ssids = request->n_ssids; n_ssids = request->n_ssids;
n_channels = request->n_channels; n_channels = request->n_channels;
/* Copy channel array if applicable */ /* Copy channel array if applicable */
brcmf_dbg(SCAN, "### List of channelspecs to scan ### %d\n", brcmf_dbg(SCAN, "### List of channelspecs to scan ### %d\n",
n_channels); n_channels);
...@@ -926,16 +923,8 @@ static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg, ...@@ -926,16 +923,8 @@ static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg,
ptr += sizeof(ssid_le); ptr += sizeof(ssid_le);
} }
} else { } else {
brcmf_dbg(SCAN, "Broadcast scan %p\n", request->ssids); brcmf_dbg(SCAN, "Performing passive scan\n");
if ((request->ssids) && request->ssids->ssid_len) { params_le->scan_type = BRCMF_SCANTYPE_PASSIVE;
brcmf_dbg(SCAN, "SSID %s len=%d\n",
params_le->ssid_le.SSID,
request->ssids->ssid_len);
params_le->ssid_le.SSID_len =
cpu_to_le32(request->ssids->ssid_len);
memcpy(&params_le->ssid_le.SSID, request->ssids->ssid,
request->ssids->ssid_len);
}
} }
/* Adding mask to channel numbers */ /* Adding mask to channel numbers */
params_le->channel_num = params_le->channel_num =
......
...@@ -45,6 +45,11 @@ ...@@ -45,6 +45,11 @@
#define BRCMF_SCAN_PARAMS_COUNT_MASK 0x0000ffff #define BRCMF_SCAN_PARAMS_COUNT_MASK 0x0000ffff
#define BRCMF_SCAN_PARAMS_NSSID_SHIFT 16 #define BRCMF_SCAN_PARAMS_NSSID_SHIFT 16
/* scan type definitions */
#define BRCMF_SCANTYPE_DEFAULT 0xFF
#define BRCMF_SCANTYPE_ACTIVE 0
#define BRCMF_SCANTYPE_PASSIVE 1
/* primary (ie tx) key */ /* primary (ie tx) key */
#define BRCMF_PRIMARY_KEY (1 << 1) #define BRCMF_PRIMARY_KEY (1 << 1)
#define DOT11_BSSTYPE_ANY 2 #define DOT11_BSSTYPE_ANY 2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment