diff mbox

[v2,6/6] mac80211: Enable initiating radiation on indoor channels

Message ID 1389801162-14488-7-git-send-email-ilan.peer@intel.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Peer, Ilan Jan. 15, 2014, 3:52 p.m. UTC
Allow active scanning and frame injection on channels marked with
IEEE80211_CHAN_NO_IR iff the channel is also marked with
IEEE80211_CHAN_INDOOR_ONLY and the wireless core thinks that it
operates in an indoor environment.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
---
 net/mac80211/scan.c |    8 +++-----
 net/mac80211/tx.c   |    2 +-
 2 files changed, 4 insertions(+), 6 deletions(-)

Comments

Luis R. Rodriguez Jan. 25, 2014, 12:21 a.m. UTC | #1
On Wed, Jan 15, 2014 at 05:52:42PM +0200, Ilan Peer wrote:
> +		if (!regulatory_ir_allowed(req->channels[0]) ||

Please keep in mind that the feature flag on the wiphy would
be used in your regulatory_ir_allowed() routine.

  Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 4d73c46..fd4f58a 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -525,8 +525,7 @@  static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
 		/* We need to ensure power level is at max for scanning. */
 		ieee80211_hw_config(local, 0);
 
-		if ((req->channels[0]->flags &
-		     IEEE80211_CHAN_NO_IR) ||
+		if (!regulatory_ir_allowed(req->channels[0]) ||
 		    !local->scan_req->n_ssids) {
 			next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
 		} else {
@@ -572,7 +571,7 @@  ieee80211_scan_get_channel_time(struct ieee80211_channel *chan)
 	 * 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 (!regulatory_ir_allowed(chan))
 		return IEEE80211_PASSIVE_CHANNEL_TIME;
 	return IEEE80211_PROBE_DELAY + IEEE80211_CHANNEL_TIME;
 }
@@ -696,8 +695,7 @@  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 ||
-	    !local->scan_req->n_ssids) {
+	if (!regulatory_ir_allowed(chan) || !local->scan_req->n_ssids) {
 		*next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
 		local->next_scan_state = SCAN_DECISION;
 		return;
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 6d59e21..596caa8 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1727,7 +1727,7 @@  netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
 	 * radar detection by itself. We can do that later by adding a
 	 * monitor flag interfaces used for AP support.
 	 */
-	if ((chan->flags & (IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_RADAR)))
+	if (!regulatory_ir_allowed(chan) || chan->flags & IEEE80211_CHAN_RADAR)
 		goto fail_rcu;
 
 	ieee80211_xmit(sdata, skb, chan->band);