From: Antonio Quartulli <antonio@meshcoding.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org,
Antonio Quartulli <antonio@meshcoding.com>,
Antonio Quartulli <antonio@open-mesh.com>
Subject: [PATCH v2 2/2] mac80211: passively scan DFS channels if requested
Date: Sat, 14 Nov 2015 09:29:20 +0800 [thread overview]
Message-ID: <1447464560-28104-2-git-send-email-antonio@meshcoding.com> (raw)
In-Reply-To: <1447464560-28104-1-git-send-email-antonio@meshcoding.com>
if the NL80211_SCAN_FLAG_PASSIVE_RADAR flag was specified upon
sw scan start, passively scan any channel marked as DFS.
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
---
v2: fix variable names and add scan_req argument to
ieee80211_scan_get_channel_time()
net/mac80211/scan.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 4aeca4b..e369d61 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -599,7 +599,9 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
if ((req->channels[0]->flags &
IEEE80211_CHAN_NO_IR) ||
- !req->n_ssids) {
+ !req->n_ssids ||
+ ((req->channels[0]->flags & IEEE80211_CHAN_RADAR) &&
+ (req->flags & NL80211_SCAN_FLAG_PASSIVE_RADAR))) {
next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
} else {
ieee80211_scan_state_send_probe(local, &next_delay);
@@ -639,13 +641,16 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
}
static unsigned long
-ieee80211_scan_get_channel_time(struct ieee80211_channel *chan)
+ieee80211_scan_get_channel_time(struct ieee80211_channel *chan,
+ struct cfg80211_scan_request *scan_req)
{
/*
* TODO: channel switching also consumes quite some time,
* add that delay as well to get a better estimation
*/
- if (chan->flags & IEEE80211_CHAN_NO_IR)
+ if ((chan->flags & IEEE80211_CHAN_NO_IR) ||
+ ((chan->flags & IEEE80211_CHAN_RADAR) &&
+ (scan_req->flags & NL80211_SCAN_FLAG_PASSIVE_RADAR)))
return IEEE80211_PASSIVE_CHANNEL_TIME;
return IEEE80211_PROBE_DELAY + IEEE80211_CHANNEL_TIME;
}
@@ -698,7 +703,8 @@ static void ieee80211_scan_state_decision(struct ieee80211_local *local,
*/
bad_latency = time_after(jiffies +
- ieee80211_scan_get_channel_time(next_chan),
+ ieee80211_scan_get_channel_time(next_chan,
+ scan_req),
local->leave_oper_channel_time + HZ / 8);
if (associated && !tx_empty) {
@@ -777,7 +783,9 @@ static void ieee80211_scan_state_set_channel(struct ieee80211_local *local,
*
* In any case, it is not necessary for a passive scan.
*/
- if (chan->flags & IEEE80211_CHAN_NO_IR || !scan_req->n_ssids) {
+ if (chan->flags & IEEE80211_CHAN_NO_IR || !scan_req->n_ssids ||
+ ((chan->flags & IEEE80211_CHAN_RADAR) &&
+ (scan_req->flags & NL80211_SCAN_FLAG_PASSIVE_RADAR))) {
*next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
local->next_scan_state = SCAN_DECISION;
return;
--
2.6.3
next prev parent reply other threads:[~2015-11-14 1:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-14 1:29 [PATCH v2 1/2] nl80211: add flag to force passive scan on DFS channels Antonio Quartulli
2015-11-14 1:29 ` Antonio Quartulli [this message]
2015-11-20 10:49 ` [PATCH v2 2/2] mac80211: passively scan DFS channels if requested Johannes Berg
2015-11-20 12:52 ` Antonio Quartulli
2016-10-24 12:11 ` Antonio Quartulli
2016-10-24 13:33 ` Johannes Berg
2016-10-24 13:35 ` Antonio Quartulli
2016-10-24 13:42 ` Simon Wunderlich
2016-10-24 14:07 ` Michal Kazior
2016-10-24 14:16 ` Johannes Berg
2016-10-24 14:36 ` Simon Wunderlich
2016-10-24 14:38 ` Johannes Berg
2016-10-24 14:53 ` Simon Wunderlich
2016-10-26 12:58 ` Johannes Berg
2016-10-26 13:30 ` Simon Wunderlich
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=1447464560-28104-2-git-send-email-antonio@meshcoding.com \
--to=antonio@meshcoding.com \
--cc=antonio@open-mesh.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.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.