aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Poulain <loic.poulain@linaro.org>2021-10-18 12:31:15 +0200
committerLoic Poulain <loic.poulain@linaro.org>2021-10-21 10:13:37 +0200
commit2f635fb6f3241fbd1e1b9c3b286b87752d503d79 (patch)
tree3c3a858abd4a7b74f483601655abf53f6cd2fe49
parent4ad988c5b837770d1cc1ebc6d55f7f25db14c227 (diff)
wcn36xx: Enable hardware scan offload for 5Ghz band
Until now, offload scanning for 5Ghz channels was considered broken. However it was mostly a driver issue, caused by bad reporting of the beacons/probe-resp bands and frequencies, which has been fixed. We can now allow offload scan for 5GHz band, this reduces the scanning time comparing to software driven scanning. Note that offloaded scan is limited to 48 channels, check for this.
-rw-r--r--drivers/net/wireless/ath/wcn36xx/main.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index d185dcebd04cd..4616f345f33cb 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -652,19 +652,18 @@ static int wcn36xx_hw_scan(struct ieee80211_hw *hw,
struct ieee80211_scan_request *hw_req)
{
struct wcn36xx *wcn = hw->priv;
- int i;
if (!get_feat_caps(wcn->fw_feat_caps, SCAN_OFFLOAD)) {
/* fallback to mac80211 software scan */
return 1;
}
- /* For unknown reason, the hardware offloaded scan only works with
- * 2.4Ghz channels, fallback to software scan in other cases.
- */
- for (i = 0; i < hw_req->req.n_channels; i++) {
- if (hw_req->req.channels[i]->band != NL80211_BAND_2GHZ)
- return 1;
+ /* Firmware scan offload is limited to 48 channels, fallback to
+ * software driven scanning otherwise */
+ if (hw_req->req.n_channels > 48) {
+ wcn36xx_warn("Offload scan aborted, n_channels=%u",
+ hw_req->req.n_channels);
+ return 1;
}
mutex_lock(&wcn->scan_lock);