All of lore.kernel.org
 help / color / mirror / Atom feed
From: Janusz Dziedzic <janusz.dziedzic@tieto.com>
To: linux-wireless@vger.kernel.org
Cc: johannes@sipsolutions.net, Janusz Dziedzic <janusz.dziedzic@tieto.com>
Subject: [PATCH] cfg80211: allow beaconing after CAC
Date: Tue, 29 Oct 2013 07:15:26 +0100	[thread overview]
Message-ID: <1383027326-2635-1-git-send-email-janusz.dziedzic@tieto.com> (raw)

After going throught the Channel Availability Check (CAC)
required by DFS enable beaconing. Channels that have gone
through a CAC will be in the NL80211_DFS_AVAILABLE.
Without this change APs don't start beaconing after
successful CAC.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
---
One flag could be used in the future IEEE80211_CHAN_NO_IR.

 net/wireless/chan.c |   20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index a6f5c4c..205acf2 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -432,6 +432,7 @@ static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy,
 {
 	struct ieee80211_channel *c;
 	u32 freq, start_freq, end_freq;
+	u32 ignore_flags;
 
 	start_freq = cfg80211_get_start_freq(center_freq, bandwidth);
 	end_freq = cfg80211_get_end_freq(center_freq, bandwidth);
@@ -441,13 +442,24 @@ static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy,
 		if (!c)
 			return false;
 
+		ignore_flags = IEEE80211_CHAN_RADAR;
+
 		/* check for radar flags */
-		if ((prohibited_flags & c->flags & IEEE80211_CHAN_RADAR) &&
-		    (c->dfs_state != NL80211_DFS_AVAILABLE))
-			return false;
+		if (prohibited_flags & c->flags & IEEE80211_CHAN_RADAR) {
+			if (c->dfs_state != NL80211_DFS_AVAILABLE)
+				return false;
+			/*
+			 * If DFS is required we should check only
+			 * c->dfs_state == NL80211_DFS_AVAILABLE and
+			 * ignore IEEE80211_CHAN_NO_IBSS and
+			 * IEEE80211_CHAN_PASSIVE_SCAN flags
+			 */
+			ignore_flags |= IEEE80211_CHAN_NO_IBSS |
+					IEEE80211_CHAN_PASSIVE_SCAN;
+		}
 
 		/* check for the other flags */
-		if (c->flags & prohibited_flags & ~IEEE80211_CHAN_RADAR)
+		if (c->flags & prohibited_flags & ~ignore_flags)
 			return false;
 	}
 
-- 
1.7.9.5


             reply	other threads:[~2013-10-29  6:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-29  6:15 Janusz Dziedzic [this message]
2013-10-29 10:25 ` [PATCH] cfg80211: allow beaconing after CAC Luis R. Rodriguez
2013-10-29 10:32   ` Janusz Dziedzic
2013-10-29 10:45     ` Luis R. Rodriguez

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=1383027326-2635-1-git-send-email-janusz.dziedzic@tieto.com \
    --to=janusz.dziedzic@tieto.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.