Skip to contentSkip to conversation

cfg80211: Allow self managed devices to update global regulatory

RFC In review Sriram R 2 participants 2 messages Sep 6, 2019 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore

Sriram R

author
#0 lore raw

RFC 1/1 cfg80211: Allow self managed devices to update global regulatory

Currently, self managed drivers cannot update the global regulatory using a regulatory hint from driver if the wiphy regd is already set from other sources.
Due to this, when a regulatory hint is provided to cfg80211 from self managed devices, the request gets ignored and global reg is always at default, i.e World reg, DFS-UNSET.
Hence in such systems, the result of 'iw reg get' does not indicate a valid global regd.

Hence, Allow setting the cfg80211 global regulatory when it is unset and the requestor is a self managed device. At the same time, do not propagate these hints to other devices in the system.

---
 net/wireless/reg.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
net/wireless/reg.c +14 -0
index 646107a..86c4460 100644
@@ -3550,6 +3550,20 @@ static int reg_set_rd_driver(const struct ieee80211_regdomain *rd,
 	if (!request_wiphy)
 		return -ENODEV;
 
+	/* Update cfg80211 regdomain only if it's unset, in case a hint
+	 * is received from self managed wiphy. Ignore all other
+	 * processing from self managed wiphy's. Return EALREADY to avoid
+	 * updating other drivers.
+	 */
+	if (request_wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) {
+		regd = get_cfg80211_regdom();
+
+		if (regd == cfg80211_world_regdom) {
+			reset_regdomains(false, rd);
+		}
+		return -EALREADY;
+	}
+
 	if (!driver_request->intersect) {
 		if (request_wiphy->regd)
 			return -EALREADY;
Signature · 1 line
2.7.4
maintainer
#1 lore raw
Quoted 8 lines · Sriram R

Currently, self managed drivers cannot update the global regulatory using a regulatory hint from driver if the wiphy regd is already set from other sources.
Due to this, when a regulatory hint is provided to cfg80211 from self managed devices, the request gets ignored and global reg is always at default, i.e World reg, DFS-UNSET.
Hence in such systems, the result of 'iw reg get' does not indicate a valid global regd.

Yeah, but ... if you have a self-managed PHY you should anyway use

iw phy0 reg get

instead of plain

iw reg get

so I'm not sure I understand?

johannes