brcmfmac: On scan timeout do send received results.
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / brcm80211 / brcmfmac / wl_cfg80211.c
index 02fe706fc9ec8cbeed88baacc377c33e6892dd6d..6860501bc1794fc37ef3b206d842ba5b7127de8c 100644 (file)
@@ -2394,9 +2394,13 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_info *cfg,
        brcmf_dbg(CONN, "Beacon interval: %d\n", notify_interval);
        brcmf_dbg(CONN, "Signal: %d\n", notify_signal);
 
-       bss = cfg80211_inform_bss(wiphy, notify_channel, (const u8 *)bi->BSSID,
-               0, notify_capability, notify_interval, notify_ie,
-               notify_ielen, notify_signal, GFP_KERNEL);
+       bss = cfg80211_inform_bss(wiphy, notify_channel,
+                                 CFG80211_BSS_FTYPE_UNKNOWN,
+                                 (const u8 *)bi->BSSID,
+                                 0, notify_capability,
+                                 notify_interval, notify_ie,
+                                 notify_ielen, notify_signal,
+                                 GFP_KERNEL);
 
        if (!bss)
                return -ENOMEM;
@@ -2422,7 +2426,7 @@ static s32 brcmf_inform_bss(struct brcmf_cfg80211_info *cfg)
        s32 err = 0;
        int i;
 
-       bss_list = cfg->bss_list;
+       bss_list = (struct brcmf_scan_results *)cfg->escan_info.escan_buf;
        if (bss_list->count != 0 &&
            bss_list->version != BRCMF_BSS_INFO_VERSION) {
                brcmf_err("Version %d != WL_BSS_INFO_VERSION\n",
@@ -2498,9 +2502,11 @@ static s32 wl_inform_ibss(struct brcmf_cfg80211_info *cfg,
        brcmf_dbg(CONN, "beacon interval: %d\n", notify_interval);
        brcmf_dbg(CONN, "signal: %d\n", notify_signal);
 
-       bss = cfg80211_inform_bss(wiphy, notify_channel, bssid,
-               0, notify_capability, notify_interval,
-               notify_ie, notify_ielen, notify_signal, GFP_KERNEL);
+       bss = cfg80211_inform_bss(wiphy, notify_channel,
+                                 CFG80211_BSS_FTYPE_UNKNOWN, bssid, 0,
+                                 notify_capability, notify_interval,
+                                 notify_ie, notify_ielen, notify_signal,
+                                 GFP_KERNEL);
 
        if (!bss) {
                err = -ENOMEM;
@@ -2596,6 +2602,7 @@ static void brcmf_cfg80211_escan_timeout_worker(struct work_struct *work)
                        container_of(work, struct brcmf_cfg80211_info,
                                     escan_timeout_work);
 
+       brcmf_inform_bss(cfg);
        brcmf_notify_escan_complete(cfg, cfg->escan_info.ifp, true, true);
 }
 
@@ -2734,12 +2741,9 @@ brcmf_cfg80211_escan_handler(struct brcmf_if *ifp,
                if (brcmf_p2p_scan_finding_common_channel(cfg, NULL))
                        goto exit;
                if (cfg->scan_request) {
-                       cfg->bss_list = (struct brcmf_scan_results *)
-                               cfg->escan_info.escan_buf;
                        brcmf_inform_bss(cfg);
                        aborted = status != BRCMF_E_STATUS_SUCCESS;
-                       brcmf_notify_escan_complete(cfg, ifp, aborted,
-                                                   false);
+                       brcmf_notify_escan_complete(cfg, ifp, aborted, false);
                } else
                        brcmf_dbg(SCAN, "Ignored scan complete result 0x%x\n",
                                  status);