* [PATCH] wl12xx: fix forced passive scans
@ 2011-09-22 7:30 Luciano Coelho
2011-09-22 7:48 ` [PATCH v2] " Luciano Coelho
0 siblings, 1 reply; 3+ messages in thread
From: Luciano Coelho @ 2011-09-22 7:30 UTC (permalink / raw)
To: coelho; +Cc: yoni.divinsky, linux-wireless
We were using incorrect max and min dwell times during forced passive
scans because we were still using the active scan states to scan
(passively) the channels that were not marked as passive.
Instead of doing passive scans in active states, we now skip active
states and scan for all channels in passive states.
Signed-off-by: Luciano Coelho <coelho@ti.com>
---
This replaces Shahar Levi's "Set the correct min&max dwell time
setting on passive scan".
Also thanks to Yoni Divinsky who also proposed a similar fix.
drivers/net/wireless/wl12xx/scan.c | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/scan.c b/drivers/net/wireless/wl12xx/scan.c
index eeccc9f..08f7e82 100644
--- a/drivers/net/wireless/wl12xx/scan.c
+++ b/drivers/net/wireless/wl12xx/scan.c
@@ -99,14 +99,18 @@ static int wl1271_get_scan_channels(struct wl1271 *wl,
for (i = 0, j = 0;
i < req->n_channels && j < WL1271_SCAN_MAX_CHANNELS;
i++) {
-
flags = req->channels[i]->flags;
if (!test_bit(i, wl->scan.scanned_ch) &&
!(flags & IEEE80211_CHAN_DISABLED) &&
- ((!!(flags & IEEE80211_CHAN_PASSIVE_SCAN)) == passive) &&
- (req->channels[i]->band == band)) {
-
+ (req->channels[i]->band == band) &&
+ /*
+ * In passive scans, we scan all remaining
+ * channels, even if not marked as such.
+ * In active scans, we only scan channels not
+ * marked as passive.
+ */
+ (passive || !(flags & IEEE80211_CHAN_PASSIVE_SCAN))) {
wl1271_debug(DEBUG_SCAN, "band %d, center_freq %d ",
req->channels[i]->band,
req->channels[i]->center_freq);
@@ -158,6 +162,10 @@ static int wl1271_scan_send(struct wl1271 *wl, enum ieee80211_band band,
int ret;
u16 scan_options = 0;
+ /* skip active scans if we don't have SSIDs */
+ if (!passive && wl->scan.req->n_ssids == 0)
+ return WL1271_NOTHING_TO_SCAN;
+
cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
trigger = kzalloc(sizeof(*trigger), GFP_KERNEL);
if (!cmd || !trigger) {
@@ -165,8 +173,7 @@ static int wl1271_scan_send(struct wl1271 *wl, enum ieee80211_band band,
goto out;
}
- /* No SSIDs means that we have a forced passive scan */
- if (passive || wl->scan.req->n_ssids == 0)
+ if (passive)
scan_options |= WL1271_SCAN_OPT_PASSIVE;
if (WARN_ON(wl->role_id == WL12XX_INVALID_ROLE_ID)) {
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH v2] wl12xx: fix forced passive scans
2011-09-22 7:30 [PATCH] wl12xx: fix forced passive scans Luciano Coelho
@ 2011-09-22 7:48 ` Luciano Coelho
2011-09-22 10:22 ` Luciano Coelho
0 siblings, 1 reply; 3+ messages in thread
From: Luciano Coelho @ 2011-09-22 7:48 UTC (permalink / raw)
To: coelho; +Cc: yoni.divinsky, linux-wireless, stable
We were using incorrect max and min dwell times during forced passive
scans because we were still using the active scan states to scan
(passively) the channels that were not marked as passive.
Instead of doing passive scans in active states, we now skip active
states and scan for all channels in passive states.
Cc: <stable@kernel.org> # 2.6.36+
Signed-off-by: Luciano Coelho <coelho@ti.com>
---
In v2 I just added Cc stable.
drivers/net/wireless/wl12xx/scan.c | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/scan.c b/drivers/net/wireless/wl12xx/scan.c
index eeccc9f..08f7e82 100644
--- a/drivers/net/wireless/wl12xx/scan.c
+++ b/drivers/net/wireless/wl12xx/scan.c
@@ -99,14 +99,18 @@ static int wl1271_get_scan_channels(struct wl1271 *wl,
for (i = 0, j = 0;
i < req->n_channels && j < WL1271_SCAN_MAX_CHANNELS;
i++) {
-
flags = req->channels[i]->flags;
if (!test_bit(i, wl->scan.scanned_ch) &&
!(flags & IEEE80211_CHAN_DISABLED) &&
- ((!!(flags & IEEE80211_CHAN_PASSIVE_SCAN)) == passive) &&
- (req->channels[i]->band == band)) {
-
+ (req->channels[i]->band == band) &&
+ /*
+ * In passive scans, we scan all remaining
+ * channels, even if not marked as such.
+ * In active scans, we only scan channels not
+ * marked as passive.
+ */
+ (passive || !(flags & IEEE80211_CHAN_PASSIVE_SCAN))) {
wl1271_debug(DEBUG_SCAN, "band %d, center_freq %d ",
req->channels[i]->band,
req->channels[i]->center_freq);
@@ -158,6 +162,10 @@ static int wl1271_scan_send(struct wl1271 *wl, enum ieee80211_band band,
int ret;
u16 scan_options = 0;
+ /* skip active scans if we don't have SSIDs */
+ if (!passive && wl->scan.req->n_ssids == 0)
+ return WL1271_NOTHING_TO_SCAN;
+
cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
trigger = kzalloc(sizeof(*trigger), GFP_KERNEL);
if (!cmd || !trigger) {
@@ -165,8 +173,7 @@ static int wl1271_scan_send(struct wl1271 *wl, enum ieee80211_band band,
goto out;
}
- /* No SSIDs means that we have a forced passive scan */
- if (passive || wl->scan.req->n_ssids == 0)
+ if (passive)
scan_options |= WL1271_SCAN_OPT_PASSIVE;
if (WARN_ON(wl->role_id == WL12XX_INVALID_ROLE_ID)) {
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2] wl12xx: fix forced passive scans
2011-09-22 7:48 ` [PATCH v2] " Luciano Coelho
@ 2011-09-22 10:22 ` Luciano Coelho
0 siblings, 0 replies; 3+ messages in thread
From: Luciano Coelho @ 2011-09-22 10:22 UTC (permalink / raw)
To: linux-wireless; +Cc: stable, yoni.divinsky
On Thu, 2011-09-22 at 10:48 +0300, Luciano Coelho wrote:
> We were using incorrect max and min dwell times during forced passive
> scans because we were still using the active scan states to scan
> (passively) the channels that were not marked as passive.
>
> Instead of doing passive scans in active states, we now skip active
> states and scan for all channels in passive states.
>
> Cc: <stable@kernel.org> # 2.6.36+
> Signed-off-by: Luciano Coelho <coelho@ti.com>
> ---
Applied.
--
Cheers,
Luca.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-09-22 10:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-22 7:30 [PATCH] wl12xx: fix forced passive scans Luciano Coelho
2011-09-22 7:48 ` [PATCH v2] " Luciano Coelho
2011-09-22 10:22 ` Luciano Coelho
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox