brcmfmac: Handle status == BRCMF_E_STATUS_ABORT in cfg80211_escan_handler
authorHans de Goede <hdegoede@redhat.com>
Wed, 8 Mar 2017 13:50:17 +0000 (14:50 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 20 Mar 2017 17:14:17 +0000 (19:14 +0200)
If a scan gets aborted BRCMF_SCAN_STATUS_BUSY gets cleared in
cfg->scan_status and when we receive an abort event from the firmware
the BRCMF_SCAN_STATUS_BUSY check in the cfg80211_escan_handler will
trigger resulting in multiple errors getting logged.

Check for a status of BRCMF_E_STATUS_ABORT and in this case simply
cleanly exit the cfg80211_escan_handler. This also avoids a
BRCMF_E_STATUS_ABORT event arriving after a new scan has been started
causing the new scan to complete prematurely without any data.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c

index 7765ad09d793fb4aeeb89559a82aa529726f76e6..4e1ca69f6aa1c27fd9530e7f14a36a0101657b85 100644 (file)
@@ -3097,6 +3097,9 @@ brcmf_cfg80211_escan_handler(struct brcmf_if *ifp,
 
        status = e->status;
 
+       if (status == BRCMF_E_STATUS_ABORT)
+               goto exit;
+
        if (!test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
                brcmf_err("scan not ready, bsscfgidx=%d\n", ifp->bsscfgidx);
                return -EPERM;