All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] cfg80211: introduce sync regdom set API for self-managed
@ 2015-01-01 11:42 Arik Nemtsov
  2015-01-01 11:42 ` [PATCH 2/2] cfg80211: avoid reg-hints in self-managed only systems Arik Nemtsov
  2015-01-06 10:54 ` [PATCH 1/2] cfg80211: introduce sync regdom set API for self-managed Johannes Berg
  0 siblings, 2 replies; 10+ messages in thread
From: Arik Nemtsov @ 2015-01-01 11:42 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, Luis R. Rodriguez, Arik Nemtsov

A self-managed device will sometimes need to set its regdomain synchronously.
Notably it should be set before usermode has a chance to query it. Expose
a new API to accomplish this which requires the RTNL.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 include/net/cfg80211.h | 14 ++++++++++++++
 net/wireless/reg.c     | 17 +++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index bd672ea..cb0bba2 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -3827,6 +3827,20 @@ int regulatory_set_wiphy_regd(struct wiphy *wiphy,
 			      struct ieee80211_regdomain *rd);
 
 /**
+ * regulatory_set_wiphy_regd_sync_rtnl - set regdom for self-managed drivers
+ * @wiphy: the wireless device we want to process the regulatory domain on
+ * @rd: the regulatory domain information to use for this wiphy
+ *
+ * This functions requires the RTNL to be held and applies the new regdomain
+ * synchronously to this wiphy. For more details see
+ * regulatory_set_wiphy_regd().
+ *
+ * Return: 0 on success. -EINVAL, -EPERM
+ */
+int regulatory_set_wiphy_regd_sync_rtnl(struct wiphy *wiphy,
+					struct ieee80211_regdomain *rd);
+
+/**
  * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain
  * @wiphy: the wireless device we want to process the regulatory domain on
  * @regd: the custom regulatory domain to use for this wiphy
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 9a5411c..9b5662f 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2928,6 +2928,23 @@ int regulatory_set_wiphy_regd(struct wiphy *wiphy,
 }
 EXPORT_SYMBOL(regulatory_set_wiphy_regd);
 
+int regulatory_set_wiphy_regd_sync_rtnl(struct wiphy *wiphy,
+					struct ieee80211_regdomain *rd)
+{
+	int ret;
+
+	ASSERT_RTNL();
+
+	ret = regulatory_set_wiphy_regd(wiphy, rd);
+	if (ret)
+		return ret;
+
+	/* process the request immediately */
+	reg_process_self_managed_hints();
+	return 0;
+}
+EXPORT_SYMBOL(regulatory_set_wiphy_regd_sync_rtnl);
+
 void wiphy_regulatory_register(struct wiphy *wiphy)
 {
 	struct regulatory_request *lr;
-- 
2.1.0


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

end of thread, other threads:[~2015-01-07 13:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-01 11:42 [PATCH 1/2] cfg80211: introduce sync regdom set API for self-managed Arik Nemtsov
2015-01-01 11:42 ` [PATCH 2/2] cfg80211: avoid reg-hints in self-managed only systems Arik Nemtsov
2015-01-06 10:56   ` Johannes Berg
2015-01-06 13:59     ` Johannes Berg
2015-01-06 14:04       ` Arik Nemtsov
2015-01-07 13:38         ` Arik Nemtsov
2015-01-07 13:42           ` Johannes Berg
2015-01-07 13:45             ` Arik Nemtsov
2015-01-06 10:54 ` [PATCH 1/2] cfg80211: introduce sync regdom set API for self-managed Johannes Berg
2015-01-07 13:35   ` Arik Nemtsov

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.