From 1687eee235d2c812f9ad433eae6b0aa04e0a39c2 Mon Sep 17 00:00:00 2001 From: Arend van Spriel Date: Tue, 23 Apr 2013 12:53:11 +0200 Subject: [PATCH] brcmfmac: allow scanning to be suppressed in the driver During the DHCP protocol exchange it is benificial to suppress scan requests which may decrease time to complete DHCP protocol. Reviewed-by: Hante Meuleman Reviewed-by: Pieter-Paul Giesberts Signed-off-by: Arend van Spriel Signed-off-by: John W. Linville --- drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 10 ++++++++++ drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c index ba92d6d7dfdd..29b4ea43a40f 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c @@ -856,6 +856,11 @@ brcmf_cfg80211_escan(struct wiphy *wiphy, struct brcmf_cfg80211_vif *vif, cfg->scan_status); return -EAGAIN; } + if (test_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status)) { + brcmf_err("Scanning suppressed: status (%lu)\n", + cfg->scan_status); + return -EAGAIN; + } if (test_bit(BRCMF_VIF_STATUS_CONNECTING, &ifp->vif->sme_state)) { brcmf_err("Connecting: status (%lu)\n", ifp->vif->sme_state); return -EAGAIN; @@ -3017,6 +3022,11 @@ brcmf_cfg80211_sched_scan_start(struct wiphy *wiphy, brcmf_err("Scanning already: status (%lu)\n", cfg->scan_status); return -EAGAIN; } + if (test_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status)) { + brcmf_err("Scanning suppressed: status (%lu)\n", + cfg->scan_status); + return -EAGAIN; + } if (!request->n_ssids || !request->n_match_sets) { brcmf_err("Invalid sched scan req!! n_ssids:%d\n", diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h index 0b9263e7dca4..e1983464e847 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h @@ -77,14 +77,16 @@ /** - * enum brcmf_scan_status - dongle scan status + * enum brcmf_scan_status - scan engine status * * @BRCMF_SCAN_STATUS_BUSY: scanning in progress on dongle. * @BRCMF_SCAN_STATUS_ABORT: scan being aborted on dongle. + * @BRCMF_SCAN_STATUS_SUPPRESS: scanning is suppressed in driver. */ enum brcmf_scan_status { BRCMF_SCAN_STATUS_BUSY, BRCMF_SCAN_STATUS_ABORT, + BRCMF_SCAN_STATUS_SUPPRESS, }; /** -- 2.20.1