All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
To: Loic Poulain <loic.poulain@linaro.org>, kvalo@codeaurora.org
Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 2/2] wcn36xx: Enable hardware scan offload for 5Ghz band
Date: Mon, 18 Oct 2021 23:51:47 +0100	[thread overview]
Message-ID: <d37b9978-7b0f-69ae-9c2f-693baec8bb2b@linaro.org> (raw)
In-Reply-To: <1634554678-7993-2-git-send-email-loic.poulain@linaro.org>

On 18/10/2021 11:57, Loic Poulain wrote:
> 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.
> 
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> ---
>   drivers/net/wireless/ath/wcn36xx/main.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
> index 263af65..2ac8efa 100644
> --- a/drivers/net/wireless/ath/wcn36xx/main.c
> +++ b/drivers/net/wireless/ath/wcn36xx/main.c
> @@ -659,19 +659,19 @@ 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.
> +	/* Firmware scan offload is limited to 48 channels, fallback to
> +	 * software driven scanning otherwise.
>   	 */
> -	for (i = 0; i < hw_req->req.n_channels; i++) {
> -		if (hw_req->req.channels[i]->band != NL80211_BAND_2GHZ)
> -			return 1;
> +	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);
> 

Really sweet fix, good job

Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>

  reply	other threads:[~2021-10-18 22:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18 10:57 [PATCH 1/2] wcn36xx: Correct band/freq reporting on RX Loic Poulain
2021-10-18 10:57 ` [PATCH 2/2] wcn36xx: Enable hardware scan offload for 5Ghz band Loic Poulain
2021-10-18 22:51   ` Bryan O'Donoghue [this message]
2021-10-18 22:51 ` [PATCH 1/2] wcn36xx: Correct band/freq reporting on RX Bryan O'Donoghue
2021-10-19  0:28   ` Bryan O'Donoghue
2021-10-20 13:54     ` Loic Poulain
2021-10-20 16:28       ` Bryan O'Donoghue
2021-10-21  5:44         ` Kalle Valo
2021-10-27  7:41 ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d37b9978-7b0f-69ae-9c2f-693baec8bb2b@linaro.org \
    --to=bryan.odonoghue@linaro.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=loic.poulain@linaro.org \
    --cc=wcn36xx@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.