linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath6kl: Store scan request info in-advance before sending SCAN request
@ 2012-03-28 13:20 rmani
  2012-03-28 13:38 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: rmani @ 2012-03-28 13:20 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, ath6kl-devel, Raja Mani

From: Raja Mani <rmani@qca.qualcomm.com>

In current code, Scan request info is recorded in vif->scan_req
after sending SCAN request to the firmware in ath6kl_cfg80211_scan().

In some corner cases, firmware sends SCAN_COMPLETE event immediately
when it receives SCAN request, which internally executes scan
complete event handler ath6kl_cfg80211_scan_complete_event() first.
So, Scan completion handler will a get a chance to executed even
before storing scan request info in ath6kl_cfg80211_scan().

Scan completion handler never report SCAN_COMPLETE event to
cfg80211 if scan request info(vif->scan_req) is NULL. This leads
to scan failure issue ("Device or resource busy error") during
next SCAN request from the user space. This patch ensures that scan
request info is stored before sending SCAN request.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/cfg80211.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index df95e0d..dd07ae5 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -941,6 +941,8 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
 	if (test_bit(CONNECTED, &vif->flags))
 		force_fg_scan = 1;
 
+	vif->scan_req = request;
+
 	if (test_bit(ATH6KL_FW_CAPABILITY_STA_P2PDEV_DUPLEX,
 		     ar->fw_capabilities)) {
 		/*
@@ -963,10 +965,10 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
 						ATH6KL_FG_SCAN_INTERVAL,
 						n_channels, channels);
 	}
-	if (ret)
+	if (ret) {
 		ath6kl_err("wmi_startscan_cmd failed\n");
-	else
-		vif->scan_req = request;
+		vif->scan_req = NULL;
+	}
 
 	kfree(channels);
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-28 13:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-28 13:20 [PATCH] ath6kl: Store scan request info in-advance before sending SCAN request rmani
2012-03-28 13:38 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).