All of lore.kernel.org
 help / color / mirror / Atom feed
From: Loic Poulain <loic.poulain@linaro.org>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org, wcn36xx@lists.infradead.org,
	Loic Poulain <loic.poulain@linaro.org>
Subject: [PATCH] net: wireless: wcn36xx: Handle scan initialization error
Date: Tue, 25 May 2021 18:05:39 +0200	[thread overview]
Message-ID: <1621958739-5557-1-git-send-email-loic.poulain@linaro.org> (raw)

In case firmware is not able to initialize scanning, return
an error to skip scanning on the channel. Scan initialization
can fail, if e.g. the firmware is not able to submit the null
function packet with PS bit set.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/main.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index eaa38d3..c99c670 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -433,8 +433,11 @@ static int wcn36xx_config(struct ieee80211_hw *hw, u32 changed)
 			/* A scan is ongoing, do not change the operating
 			 * channel, but start a scan session on the channel.
 			 */
-			wcn36xx_smd_init_scan(wcn, HAL_SYS_MODE_SCAN,
-					      wcn->sw_scan_vif);
+			if (wcn36xx_smd_init_scan(wcn, HAL_SYS_MODE_SCAN,
+						  wcn->sw_scan_vif)) {
+				mutex_unlock(&wcn->conf_mutex);
+				return -EIO;
+			}
 			wcn36xx_smd_start_scan(wcn, ch);
 		} else {
 			wcn36xx_change_opchannel(wcn, ch);
-- 
2.7.4


             reply	other threads:[~2021-05-25 15:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25 16:05 Loic Poulain [this message]
2021-06-12 10:55 ` [PATCH] net: wireless: wcn36xx: Handle scan initialization error 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=1621958739-5557-1-git-send-email-loic.poulain@linaro.org \
    --to=loic.poulain@linaro.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.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.