Skip to contentSkip to conversation

ath6kl: support NL80211_USER_REG_HINT_CELL_BASE events

PATCH Applied Kalle Valo 2 participants 3 messages Nov 16, 2012 – Nov 17, 2012 Atheros ATH6KL wireless driver

lore
Share & tools
lore

Kalle Valo

author
#0 lore raw

PATCH 1/1 ath6kl: support NL80211_USER_REG_HINT_CELL_BASE events

As ath6kl firmware can't do intersections the driver should only listen to regdom changes from cellular base stations, all other requests need to be refused.

---
 drivers/net/wireless/ath/ath6kl/cfg80211.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath6kl/cfg80211.c +12 -3
index bf5e7d5..41dea0d 100644
@@ -3500,11 +3500,18 @@ static int ath6kl_cfg80211_reg_notify(struct wiphy *wiphy,
 	int ret, i;
 
 	ath6kl_dbg(ATH6KL_DBG_WLAN_CFG,
-		   "cfg reg_notify %c%c%s%s initiator %d\n",
+		   "cfg reg_notify %c%c%s%s initiator %d hint_type %d\n",
 		   request->alpha2[0], request->alpha2[1],
 		   request->intersect ? " intersect" : "",
 		   request->processed ? " processed" : "",
-		   request->initiator);
+		   request->initiator, request->user_reg_hint_type);
+
+	/*
+	 * As firmware is not able intersect regdoms, we can only listen to
+	 * cellular hints.
+	 */
+	if (request->user_reg_hint_type != NL80211_USER_REG_HINT_CELL_BASE)
+		return -EOPNOTSUPP;
 
 	ret = ath6kl_wmi_set_regdomain_cmd(ar->wmi, request->alpha2);
 	if (ret) {
@@ -3668,8 +3675,10 @@ int ath6kl_cfg80211_init(struct ath6kl *ar)
 	}
 
 	if (config_enabled(CONFIG_ATH6KL_REGDOMAIN) &&
-	    test_bit(ATH6KL_FW_CAPABILITY_REGDOMAIN, ar->fw_capabilities))
+	    test_bit(ATH6KL_FW_CAPABILITY_REGDOMAIN, ar->fw_capabilities)) {
 		wiphy->reg_notifier = ath6kl_cfg80211_reg_notify;
+		ar->wiphy->features |= NL80211_FEATURE_CELL_BASE_REG_HINTS;
+	}
 
 	/* max num of ssids that can be probed during scanning */
 	wiphy->max_scan_ssids = MAX_PROBED_SSIDS;
author Applied
#1 lore raw
Quoted 5 lines · Kalle Valo

As ath6kl firmware can't do intersections the driver should only listen to regdom changes from cellular base stations, all other requests need to be refused.

Applied.

Kalle

#2 lore raw
In reply to Kalle Valo
Quoted 21 lines · Kalle Valo

As ath6kl firmware can't do intersections the driver should only listen to regdom changes from cellular base stations, all other requests need to be refused.

---
 drivers/net/wireless/ath/ath6kl/cfg80211.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath6kl/cfg80211.c +1 -1
index bf5e7d5..41dea0d 100644
@@ -3500,11 +3500,18 @@ static int ath6kl_cfg80211_reg_notify(struct wiphy *wiphy,
 	int ret, i;
 
 	ath6kl_dbg(ATH6KL_DBG_WLAN_CFG,
-		   "cfg reg_notify %c%c%s%s initiator %d\n",
+		   "cfg reg_notify %c%c%s%s initiator %d hint_type %d\n",
 		   request->alpha2[0], request->alpha2[1],
 		   request->intersect ? " intersect" : "",

drivers/net/wireless/ath/ath6kl/cfg80211.c static int ath6kl_cfg80211_reg_notify(struct wiphy *wiphy, · line 3514

Quoted 10 lines
drivers/net/wireless/ath/ath6kl/cfg80211.c +8 -1
 		   request->processed ? " processed" : "",
-		   request->initiator);
+		   request->initiator, request->user_reg_hint_type);
+
+	/*
+	 * As firmware is not able intersect regdoms, we can only listen to
+	 * cellular hints.
+	 */
+	if (request->user_reg_hint_type != NL80211_USER_REG_HINT_CELL_BASE)
+		return -EOPNOTSUPP;

The reg_notifier() doesn't need to process all requests and we don't care if it fails so a few things for the future if its not too late to respin:

* The reg_notifier() on the kernel can be made to return void, and simply allow routines to exit early by a simple non return return.

* The comment at the top here seems non relevant as feature is to support cell base station hints, not to support or process all hints. That is, the reg notifier does work with the fimrware only in case of the cell base station hint.

Luis