All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] wiphy-specific regulatory management
@ 2014-10-23  6:37 Arik Nemtsov
  2014-10-23  6:37 ` [PATCH 1/5] cfg80211: introduce regulatory flags controlling bw Arik Nemtsov
                   ` (5 more replies)
  0 siblings, 6 replies; 26+ messages in thread
From: Arik Nemtsov @ 2014-10-23  6:37 UTC (permalink / raw)
  To: linux-wireless; +Cc: Luis R. Rodriguez, Arik Nemtsov

This series includes two patches sent previously - allowing more channel
flags to propagate from regdom info and introducing a regulatory enforcement
mechanism for interfaces inhibiting a forbidden channel after a regulatory
update.

Introduce wiphy-specific regulatory management. This allows devices to manage
regdomain changes exclusively for their own wiphy. These devices do not update
the cfg80211 regdomain and are unaffected by hints external to the device/FW.
Introduce a new API to allow these devices to set their own regdomain.

Arik Nemtsov (2):
  cfg80211: introduce regulatory flags controlling bw
  cfg80211: leave invalid channels on regdomain change

Jonathan Doron (3):
  cfg80211: update missing fields in custom regulatory path
  cfg80211: allow wiphy specific regdomain management
  cfg80211: Allow usermode to query wiphy specific regd info

 include/net/cfg80211.h       |  14 +++
 include/net/regulatory.h     |   9 ++
 include/uapi/linux/nl80211.h |  23 +++++
 net/wireless/core.c          |   7 ++
 net/wireless/nl80211.c       | 132 ++++++++++++++++++++++------
 net/wireless/nl80211.h       |   1 +
 net/wireless/reg.c           | 201 ++++++++++++++++++++++++++++++++++++++++++-
 net/wireless/reg.h           |   1 +
 8 files changed, 356 insertions(+), 32 deletions(-)

-- 
1.9.1


^ permalink raw reply	[flat|nested] 26+ messages in thread
* [PATCH 1/5] cfg80211: introduce regulatory flags controlling bw
@ 2014-06-11  6:55 Arik Nemtsov
  2014-06-11  6:58 ` Arik Nemtsov
  2014-06-18 21:54 ` Luis R. Rodriguez
  0 siblings, 2 replies; 26+ messages in thread
From: Arik Nemtsov @ 2014-06-11  6:55 UTC (permalink / raw)
  To: linux-wireless; +Cc: Luis R. Rodriguez, Arik Nemtsov

Allow setting bandwidth related regulatory flags. These flags are mapped
to the corresponding channel flags in the specified range.
Make sure the new flags are consulted when calculating the maximum
bandwidth allowed by a regulatory-rule.

Also allow propagating the GO_CONCURRENT modifier from a reg-rule to a
channel.

Change-Id: Ic120a291ef7a56f2efa800e77e9689c6c421affa
Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-on: https://gerrit.rds.intel.com/32263
Tested-by: IWL Jenkins
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
---
 include/uapi/linux/nl80211.h | 12 ++++++++++++
 net/wireless/reg.c           | 30 ++++++++++++++++++++++++++++--
 2 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index fb0efa1..e87f187 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2572,6 +2572,11 @@ enum nl80211_sched_scan_match_attr {
  * @NL80211_RRF_AUTO_BW: maximum available bandwidth should be calculated
  *	base on contiguous rules and wider channels will be allowed to cross
  *	multiple contiguous/overlapping frequency ranges.
+ * @NL80211_RRF_GO_CONCURRENT: See &NL80211_FREQUENCY_ATTR_GO_CONCURRENT
+ * @NL80211_RRF_NO_HT40MINUS: channels can't be used in HT40- operation
+ * @NL80211_RRF_NO_HT40PLUS: channels can't be used in HT40+ operation
+ * @NL80211_RRF_NO_80MHZ: 80MHz operation not allowed
+ * @NL80211_RRF_NO_160MHZ: 160MHz operation not allowed
  */
 enum nl80211_reg_rule_flags {
 	NL80211_RRF_NO_OFDM		= 1<<0,
@@ -2584,11 +2589,18 @@ enum nl80211_reg_rule_flags {
 	NL80211_RRF_NO_IR		= 1<<7,
 	__NL80211_RRF_NO_IBSS		= 1<<8,
 	NL80211_RRF_AUTO_BW		= 1<<11,
+	NL80211_RRF_GO_CONCURRENT	= 1<<12,
+	NL80211_RRF_NO_HT40MINUS	= 1<<13,
+	NL80211_RRF_NO_HT40PLUS		= 1<<14,
+	NL80211_RRF_NO_80MHZ		= 1<<15,
+	NL80211_RRF_NO_160MHZ		= 1<<16,
 };
 
 #define NL80211_RRF_PASSIVE_SCAN	NL80211_RRF_NO_IR
 #define NL80211_RRF_NO_IBSS		NL80211_RRF_NO_IR
 #define NL80211_RRF_NO_IR		NL80211_RRF_NO_IR
+#define NL80211_RRF_NO_HT40		(NL80211_RRF_NO_HT40MINUS |\
+					 NL80211_RRF_NO_HT40PLUS)
 
 /* For backport compatibility with older userspace */
 #define NL80211_RRF_NO_IR_ALL		(NL80211_RRF_NO_IR | __NL80211_RRF_NO_IBSS)
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 558b0e3..efd6d0d 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -572,8 +572,9 @@ static const struct ieee80211_regdomain *reg_get_regdomain(struct wiphy *wiphy)
 	return get_cfg80211_regdom();
 }
 
-unsigned int reg_get_max_bandwidth(const struct ieee80211_regdomain *rd,
-				   const struct ieee80211_reg_rule *rule)
+static unsigned int
+reg_get_max_bandwidth_from_range(const struct ieee80211_regdomain *rd,
+				 const struct ieee80211_reg_rule *rule)
 {
 	const struct ieee80211_freq_range *freq_range = &rule->freq_range;
 	const struct ieee80211_freq_range *freq_range_tmp;
@@ -621,6 +622,21 @@ unsigned int reg_get_max_bandwidth(const struct ieee80211_regdomain *rd,
 	return end_freq - start_freq;
 }
 
+unsigned int reg_get_max_bandwidth(const struct ieee80211_regdomain *rd,
+				   const struct ieee80211_reg_rule *rule)
+{
+	unsigned int bw = reg_get_max_bandwidth_from_range(rd, rule);
+
+	if (rule->flags & NL80211_RRF_NO_160MHZ)
+		bw = min_t(unsigned int, bw, MHZ_TO_KHZ(80));
+	if (rule->flags & NL80211_RRF_NO_80MHZ)
+		bw = min_t(unsigned int, bw, MHZ_TO_KHZ(40));
+	if (rule->flags & NL80211_RRF_NO_HT40)
+		bw = min_t(unsigned int, bw, MHZ_TO_KHZ(20));
+
+	return bw;
+}
+
 /* Sanity check on a regulatory rule */
 static bool is_valid_reg_rule(const struct ieee80211_reg_rule *rule)
 {
@@ -906,6 +922,16 @@ static u32 map_regdom_flags(u32 rd_flags)
 		channel_flags |= IEEE80211_CHAN_NO_OFDM;
 	if (rd_flags & NL80211_RRF_NO_OUTDOOR)
 		channel_flags |= IEEE80211_CHAN_INDOOR_ONLY;
+	if (rd_flags & NL80211_RRF_GO_CONCURRENT)
+		channel_flags |= IEEE80211_CHAN_GO_CONCURRENT;
+	if (rd_flags & NL80211_RRF_NO_HT40MINUS)
+		channel_flags |= IEEE80211_CHAN_NO_HT40MINUS;
+	if (rd_flags & NL80211_RRF_NO_HT40PLUS)
+		channel_flags |= IEEE80211_CHAN_NO_HT40PLUS;
+	if (rd_flags & NL80211_RRF_NO_80MHZ)
+		channel_flags |= IEEE80211_CHAN_NO_80MHZ;
+	if (rd_flags & NL80211_RRF_NO_160MHZ)
+		channel_flags |= IEEE80211_CHAN_NO_160MHZ;
 	return channel_flags;
 }
 
-- 
1.9.1


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

end of thread, other threads:[~2014-11-16 11:10 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-23  6:37 [PATCH 0/5] wiphy-specific regulatory management Arik Nemtsov
2014-10-23  6:37 ` [PATCH 1/5] cfg80211: introduce regulatory flags controlling bw Arik Nemtsov
2014-11-05  3:07   ` Luis R. Rodriguez
2014-11-10  9:36   ` Johannes Berg
2014-10-23  6:37 ` [PATCH 2/5] cfg80211: leave invalid channels on regdomain change Arik Nemtsov
2014-11-05  3:16   ` Luis R. Rodriguez
2014-11-05  9:18     ` Arik Nemtsov
2014-11-12 22:53       ` Luis R. Rodriguez
2014-11-13 15:42         ` Arik Nemtsov
2014-10-23  6:37 ` [PATCH 3/5] cfg80211: update missing fields in custom regulatory path Arik Nemtsov
2014-11-05  3:19   ` Luis R. Rodriguez
2014-10-23  6:37 ` [PATCH 4/5] cfg80211: allow wiphy specific regdomain management Arik Nemtsov
2014-10-23  6:37 ` [PATCH 5/5] cfg80211: Allow usermode to query wiphy specific regd info Arik Nemtsov
2014-11-05  3:23   ` Luis R. Rodriguez
2014-11-05  9:12     ` Arik Nemtsov
2014-11-12 22:51       ` Luis R. Rodriguez
2014-11-13 15:55         ` Arik Nemtsov
2014-11-13 19:05           ` Luis R. Rodriguez
2014-11-16 11:09             ` Arik Nemtsov
2014-11-05  3:21 ` [PATCH 0/5] wiphy-specific regulatory management Luis R. Rodriguez
2014-11-05  8:41   ` Arik Nemtsov
2014-11-12 23:07     ` Luis R. Rodriguez
2014-11-13 15:56       ` Arik Nemtsov
  -- strict thread matches above, loose matches on Subject: below --
2014-06-11  6:55 [PATCH 1/5] cfg80211: introduce regulatory flags controlling bw Arik Nemtsov
2014-06-11  6:58 ` Arik Nemtsov
2014-06-18 21:54 ` Luis R. Rodriguez

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.