linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/6] Enable additional channels for use
@ 2014-01-27 10:21 Ilan Peer
  2014-01-27 10:21 ` [PATCH v3 1/6] cfg80211: Add indoor only and GO concurrent channel attributes Ilan Peer
                   ` (7 more replies)
  0 siblings, 8 replies; 37+ messages in thread
From: Ilan Peer @ 2014-01-27 10:21 UTC (permalink / raw)
  To: linux-wireless; +Cc: wireless-regdb, Ilan Peer

This set addresses comments from Luis:

1. Added a regulatory flag that can be used by drivers to disable the P2P
   GO relaxation.
2. Renamed the configuration option to CONFIG_CFG80211_REG_P2P_GO_RELAX.
3. Some code cleanups.

------

As before, this series addresses the option of enabling additional channels for
use based on the following relaxations:

1. Indoor operation, where a device can use channels requiring indoor
   operation, subject to that it can guarantee indoor operation.
2. Concurrent GO operation, where devices may instantiate a P2P GO
   while they are under the guidance of an authorized master.

The series includes:

* Some clarification (mainly in documentation) about the intended usage of
  channels marked as INDOOR_ONLY and CONCURRENT GO.
* Mapping of NL80211_RFF_NO_OUTDOOR to NL80211_CHAN_INDOOR_ONLY
* Support for a user hint that the platform is operating in an indoor
  environment, i.e., channel marked as INDOOR_ONLY can be used.
* Allow initiating radiation on channel marked with INDOOR_ONLY also
  for scanning an frame injection in monitor mode.
* Some additional fixes for comments I got.

Following is an example of a possible channel map that can be used to allow
the INDOOR_ONLY and CONCURRENT_GO relaxations. Note that:

* Channels 12,13 are marked as Concurrent GO, so even in the lack of exact
  information about the current regulatory domain, these channels can be used
  for GO instantiation based on the concurrent GO relaxation.
* The above is also true for channels 149-165 (a.k.a U-NII 3).
* Channels 36-48 (a.k.a thee U-NII 1), are marked both with Concurrent GO and
  indoor only. While the Concurrent GO can be used as described above, the
  indoor only setting allows to use these channels given the platform is
  identified as an indoor one, i.e., media server.

 2412 MHz [1] (16.0 dBm)
 2417 MHz [2] (16.0 dBm)
 2422 MHz [3] (16.0 dBm)
 2427 MHz [4] (16.0 dBm)
 2432 MHz [5] (16.0 dBm)
 2437 MHz [6] (16.0 dBm)
 2442 MHz [7] (16.0 dBm)
 2447 MHz [8] (16.0 dBm)
 2452 MHz [9] (16.0 dBm)
 2457 MHz [10] (16.0 dBm)
 2462 MHz [11] (16.0 dBm)
 2467 MHz [12] (16.0 dBm) (no IR, Concurrent GO)
 2472 MHz [13] (16.0 dBm) (no IR, Concurrent GO)
 5180 MHz [36] (16.0 dBm) (no IR, Indoor Only, Concurrent GO)
 5200 MHz [40] (16.0 dBm) (no IR, Indoor Only, Concurrent GO)
 5220 MHz [44] (16.0 dBm) (no IR, Indoor Only, Concurrent GO)
 5240 MHz [48] (16.0 dBm) (no IR, Indoor Only, Concurrent GO)
 5260 MHz [52] (16.0 dBm) (no IR, radar detection)
 5280 MHz [56] (16.0 dBm) (no IR, radar detection)
 5300 MHz [60] (16.0 dBm) (no IR, radar detection)
 5320 MHz [64] (16.0 dBm) (no IR, radar detection)
 5500 MHz [100] (16.0 dBm) (no IR, radar detection)
 5520 MHz [104] (16.0 dBm) (no IR, radar detection)
 5540 MHz [108] (16.0 dBm) (no IR, radar detection)
 5560 MHz [112] (16.0 dBm) (no IR, radar detection)
 5580 MHz [116] (16.0 dBm) (no IR, radar detection)
 5600 MHz [120] (16.0 dBm) (no IR, radar detection)
 5620 MHz [124] (16.0 dBm) (no IR, radar detection)
 5640 MHz [128] (16.0 dBm) (no IR, radar detection)
 5660 MHz [132] (16.0 dBm) (no IR, radar detection)
 5680 MHz [136] (16.0 dBm) (no IR, radar detection)
 5700 MHz [140] (16.0 dBm) (no IR, radar detection)
 5720 MHz [144] (16.0 dBm) (no IR, radar detection)
 5745 MHz [149] (16.0 dBm) (no IR, Concurrent GO)
 5765 MHz [153] (16.0 dBm) (no IR, Concurrent GO)
 5785 MHz [157] (16.0 dBm) (no IR, Concurrent GO)
 5805 MHz [161] (16.0 dBm) (no IR, Concurrent GO)
 5825 MHz [165] (16.0 dBm) (no IR, Concurrent GO)

Thanks in advance,

Ilan.

David Spinadel (1):
  cfg80211: Add indoor only and GO concurrent channel attributes

Ilan Peer (5):
  cfg80211: Add Kconfig option for cellular BS hints
  cfg80211: Enable GO operation on additional channels
  cfg80211: Add an option to hint indoor operation
  cfg80211: Enable GO operation on indoor channels
  mac80211: Enable initiating radiation on indoor channels

 include/net/cfg80211.h       |   41 ++++++++++++++++++++-
 include/net/regulatory.h     |    4 ++
 include/uapi/linux/nl80211.h |   10 +++++
 net/mac80211/ibss.c          |    9 +++--
 net/mac80211/scan.c          |   15 +++++---
 net/mac80211/tx.c            |    3 +-
 net/wireless/Kconfig         |   21 +++++++++++
 net/wireless/chan.c          |   74 +++++++++++++++++++++++++++++++++++--
 net/wireless/mesh.c          |    3 +-
 net/wireless/nl80211.c       |   35 +++++++++++-------
 net/wireless/reg.c           |   84 ++++++++++++++++++++++++++++++++++++++++--
 net/wireless/reg.h           |   13 +++++++
 net/wireless/trace.h         |   11 ++++--
 13 files changed, 286 insertions(+), 37 deletions(-)

-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 37+ messages in thread
* [PATCH v2 4/6] cfg80211: Add an option to hint indoor operation
@ 2013-12-03 19:16 Ilan Peer
  2013-12-04  9:16 ` [PATCH v3 " Ilan Peer
  0 siblings, 1 reply; 37+ messages in thread
From: Ilan Peer @ 2013-12-03 19:16 UTC (permalink / raw)
  To: linux-wireless; +Cc: wireless-regdb, Ilan Peer

Add the option to hint the wireless core that it is operating in an indoor
environment.

In addition add regulatory_ir_allowed(), that can be used to
test if initiation radiation is allowed based on the channel flags
and the wireless core indoor hint.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
---
 include/net/cfg80211.h       |   12 +++++++++
 include/uapi/linux/nl80211.h |    3 +++
 net/wireless/nl80211.c       |   18 ++++++-------
 net/wireless/reg.c           |   57 +++++++++++++++++++++++++++++++++++++++---
 net/wireless/reg.h           |    1 +
 5 files changed, 78 insertions(+), 13 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 504d656..8c29b3d 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -3534,6 +3534,18 @@ const struct ieee80211_reg_rule *freq_reg_info(struct wiphy *wiphy,
  */
 const char *reg_initiator_name(enum nl80211_reg_initiator initiator);
 
+/**
+ * regulatory_ir_allowed - is it allowed to initiate radiation on the channel.
+ * @chan: the channel
+ *
+ * Generally, it is not allowed to initiate radiation on a channel marked with
+ * IEEE80211_CHAN_NO_IR. The exception is operation on channels marked with
+ * IEEE80211_CHAN_INDOOR_ONLY. For such channels, initiating radiation is
+ * allowed iff the wireless core was notified that it operates in an indoor
+ * environment.
+ */
+bool regulatory_ir_allowed(struct ieee80211_channel *chan);
+
 /*
  * callbacks for asynchronous cfg80211 methods, notification
  * functions and BSS handling helpers
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index b6721a1..6674444 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2489,10 +2489,13 @@ enum nl80211_dfs_regions {
  *	present has been registered with the wireless core that
  *	has listed NL80211_FEATURE_CELL_BASE_REG_HINTS as a
  *	supported feature.
+ * @NL80211_USER_REG_HINT_INDOOR: a user sent an hint indicating that the
+ *	platform is operating in an indoor environment.
  */
 enum nl80211_user_reg_hint_type {
 	NL80211_USER_REG_HINT_USER	= 0,
 	NL80211_USER_REG_HINT_CELL_BASE = 1,
+	NL80211_USER_REG_HINT_INDOOR    = 2,
 };
 
 /**
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 267d37e..514170c 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4614,7 +4614,6 @@ static int parse_reg_rule(struct nlattr *tb[],
 
 static int nl80211_req_set_reg(struct sk_buff *skb, struct genl_info *info)
 {
-	int r;
 	char *data = NULL;
 	enum nl80211_user_reg_hint_type user_reg_hint_type;
 
@@ -4627,11 +4626,6 @@ static int nl80211_req_set_reg(struct sk_buff *skb, struct genl_info *info)
 	if (unlikely(!rcu_access_pointer(cfg80211_regdomain)))
 		return -EINPROGRESS;
 
-	if (!info->attrs[NL80211_ATTR_REG_ALPHA2])
-		return -EINVAL;
-
-	data = nla_data(info->attrs[NL80211_ATTR_REG_ALPHA2]);
-
 	if (info->attrs[NL80211_ATTR_USER_REG_HINT_TYPE])
 		user_reg_hint_type =
 		  nla_get_u32(info->attrs[NL80211_ATTR_USER_REG_HINT_TYPE]);
@@ -4641,14 +4635,18 @@ static int nl80211_req_set_reg(struct sk_buff *skb, struct genl_info *info)
 	switch (user_reg_hint_type) {
 	case NL80211_USER_REG_HINT_USER:
 	case NL80211_USER_REG_HINT_CELL_BASE:
-		break;
+		if (!info->attrs[NL80211_ATTR_REG_ALPHA2])
+			return -EINVAL;
+
+		data = nla_data(info->attrs[NL80211_ATTR_REG_ALPHA2]);
+		return regulatory_hint_user(data, user_reg_hint_type);
+	case NL80211_USER_REG_HINT_INDOOR:
+		return regulatory_hint_indoor_user();
 	default:
 		return -EINVAL;
 	}
 
-	r = regulatory_hint_user(data, user_reg_hint_type);
-
-	return r;
+	return 0;
 }
 
 static int nl80211_get_mesh_config(struct sk_buff *skb,
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 212b5c2..0361035 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -110,6 +110,14 @@ const struct ieee80211_regdomain __rcu *cfg80211_regdomain;
  */
 static int reg_num_devs_support_basehint;
 
+/*
+ * State variable indicating if the platform on which the devices
+ * are attached is operating in an indoor environment. The state variable
+ * is relevant for all registered devices.
+ * Note: currently not protected by any synchronization primitive.
+ */
+static bool reg_is_indoor;
+
 static const struct ieee80211_regdomain *get_cfg80211_regdom(void)
 {
 	return rtnl_dereference(cfg80211_regdomain);
@@ -987,6 +995,13 @@ static bool reg_request_cell_base(struct regulatory_request *request)
 	return request->user_reg_hint_type == NL80211_USER_REG_HINT_CELL_BASE;
 }
 
+static bool reg_request_indoor(struct regulatory_request *request)
+{
+	if (request->initiator != NL80211_REGDOM_SET_BY_USER)
+		return false;
+	return request->user_reg_hint_type == NL80211_USER_REG_HINT_INDOOR;
+}
+
 bool reg_last_request_cell_base(void)
 {
 	return reg_request_cell_base(get_last_request());
@@ -1423,6 +1438,9 @@ __reg_process_hint_user(struct regulatory_request *user_request)
 {
 	struct regulatory_request *lr = get_last_request();
 
+	if (reg_request_indoor(user_request))
+		return REG_REQ_OK;
+
 	if (reg_request_cell_base(user_request))
 		return reg_ignore_cell_hint(user_request);
 
@@ -1475,6 +1493,11 @@ reg_process_hint_user(struct regulatory_request *user_request)
 		return treatment;
 	}
 
+	if (reg_request_indoor(user_request) && treatment == REG_REQ_OK) {
+		reg_is_indoor = true;
+		return REG_REQ_OK;
+	}
+
 	user_request->intersect = treatment == REG_REQ_INTERSECT;
 	user_request->processed = false;
 
@@ -1658,9 +1681,6 @@ static void reg_process_hint(struct regulatory_request *reg_request)
 	struct wiphy *wiphy = NULL;
 	enum reg_request_treatment treatment;
 
-	if (WARN_ON(!reg_request->alpha2))
-		return;
-
 	if (reg_request->wiphy_idx != WIPHY_IDX_INVALID)
 		wiphy = wiphy_idx_to_wiphy(reg_request->wiphy_idx);
 
@@ -1820,6 +1840,22 @@ int regulatory_hint_user(const char *alpha2,
 	return 0;
 }
 
+int regulatory_hint_indoor_user(void)
+{
+	struct regulatory_request *request;
+
+	request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL);
+	if (!request)
+		return -ENOMEM;
+
+	request->wiphy_idx = WIPHY_IDX_INVALID;
+	request->initiator = NL80211_REGDOM_SET_BY_USER;
+	request->user_reg_hint_type = NL80211_USER_REG_HINT_INDOOR;
+	queue_regulatory_request(request);
+
+	return 0;
+}
+
 /* Driver hints */
 int regulatory_hint(struct wiphy *wiphy, const char *alpha2)
 {
@@ -2482,6 +2518,19 @@ int cfg80211_get_unii(int freq)
 	return -EINVAL;
 }
 
+bool regulatory_ir_allowed(struct ieee80211_channel *chan)
+{
+#ifdef CONFIG_CFG80211_REG_SOFT_CONFIGURATIONS
+	if (reg_is_indoor && (chan->flags & IEEE80211_CHAN_INDOOR_ONLY))
+		return true;
+#endif /* CONFIG_CFG80211_REG_SOFT_CONFIGURATIONS */
+
+	if (chan->flags & IEEE80211_CHAN_NO_IR)
+		return false;
+	return true;
+}
+EXPORT_SYMBOL(regulatory_ir_allowed);
+
 int __init regulatory_init(void)
 {
 	int err = 0;
@@ -2502,6 +2551,8 @@ int __init regulatory_init(void)
 	user_alpha2[0] = '9';
 	user_alpha2[1] = '7';
 
+	reg_is_indoor = false;
+
 	/* We always try to get an update for the static regdomain */
 	err = regulatory_hint_core(cfg80211_world_regdom->alpha2);
 	if (err) {
diff --git a/net/wireless/reg.h b/net/wireless/reg.h
index 1ef2daa..bd708d1 100644
--- a/net/wireless/reg.h
+++ b/net/wireless/reg.h
@@ -24,6 +24,7 @@ bool reg_supported_dfs_region(enum nl80211_dfs_regions dfs_region);
 
 int regulatory_hint_user(const char *alpha2,
 			 enum nl80211_user_reg_hint_type user_reg_hint_type);
+int regulatory_hint_indoor_user(void);
 
 int reg_device_uevent(struct device *dev, struct kobj_uevent_env *env);
 void wiphy_regulatory_register(struct wiphy *wiphy);
-- 
1.7.10.4


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

end of thread, other threads:[~2014-02-23  9:44 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-27 10:21 [PATCH v3 0/6] Enable additional channels for use Ilan Peer
2014-01-27 10:21 ` [PATCH v3 1/6] cfg80211: Add indoor only and GO concurrent channel attributes Ilan Peer
2014-02-18 22:49   ` Luis R. Rodriguez
2014-02-19 14:44     ` Peer, Ilan
2014-01-27 10:21 ` [PATCH v3 2/6] cfg80211: Add Kconfig option for cellular BS hints Ilan Peer
2014-02-18 22:59   ` Luis R. Rodriguez
2014-01-27 10:21 ` [PATCH v3 3/6] cfg80211: Enable GO operation on additional channels Ilan Peer
2014-01-31 14:11   ` Johannes Berg
2014-02-02 19:20     ` Peer, Ilan
2014-02-03 12:46       ` Johannes Berg
2014-02-03 13:24         ` Peer, Ilan
2014-02-18 23:38   ` Luis R. Rodriguez
2014-02-19 14:52     ` Peer, Ilan
2014-02-19 15:47       ` Luis R. Rodriguez
2014-02-20  7:31         ` Peer, Ilan
2014-01-27 10:21 ` [PATCH v3 4/6] cfg80211: Add an option to hint indoor operation Ilan Peer
2014-01-31 14:13   ` Johannes Berg
2014-02-03 11:14   ` Ilan Peer
2014-02-19  0:07   ` Luis R. Rodriguez
2014-02-19 15:18     ` Peer, Ilan
2014-01-27 10:21 ` [PATCH v3 5/6] cfg80211: Enable GO operation on indoor channels Ilan Peer
2014-02-19  0:10   ` Luis R. Rodriguez
2014-01-27 10:21 ` [PATCH v3 6/6] mac80211: Enable initiating radiation " Ilan Peer
2014-02-19  0:15   ` Luis R. Rodriguez
2014-02-19 15:28     ` Peer, Ilan
2014-02-19 16:03       ` Luis R. Rodriguez
2014-02-20  7:58         ` Peer, Ilan
2014-02-21 23:31           ` Luis R. Rodriguez
2014-02-22 18:55             ` Peer, Ilan
2014-02-22 20:22               ` Luis R. Rodriguez
2014-02-23  7:23                 ` Peer, Ilan
2014-02-23  9:43                   ` Luis R. Rodriguez
2014-01-27 10:24 ` [PATCH v3 0/6] Enable additional channels for use Peer, Ilan
2014-02-09 16:06 ` Peer, Ilan
2014-02-18 22:17   ` Luis R. Rodriguez
2014-02-18 22:18     ` Luis R. Rodriguez
  -- strict thread matches above, loose matches on Subject: below --
2013-12-03 19:16 [PATCH v2 4/6] cfg80211: Add an option to hint indoor operation Ilan Peer
2013-12-04  9:16 ` [PATCH v3 " Ilan Peer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).