|
@@ -3458,6 +3458,49 @@ void ath6kl_cfg80211_stop_all(struct ath6kl *ar)
|
|
|
ath6kl_cfg80211_stop(vif);
|
|
|
}
|
|
|
|
|
|
+static int ath6kl_cfg80211_reg_notify(struct wiphy *wiphy,
|
|
|
+ struct regulatory_request *request)
|
|
|
+{
|
|
|
+ struct ath6kl *ar = wiphy_priv(wiphy);
|
|
|
+ u32 rates[IEEE80211_NUM_BANDS];
|
|
|
+ int ret, i;
|
|
|
+
|
|
|
+ ath6kl_dbg(ATH6KL_DBG_WLAN_CFG,
|
|
|
+ "cfg reg_notify %c%c%s%s initiator %d\n",
|
|
|
+ request->alpha2[0], request->alpha2[1],
|
|
|
+ request->intersect ? " intersect" : "",
|
|
|
+ request->processed ? " processed" : "",
|
|
|
+ request->initiator);
|
|
|
+
|
|
|
+ ret = ath6kl_wmi_set_regdomain_cmd(ar->wmi, request->alpha2);
|
|
|
+ if (ret) {
|
|
|
+ ath6kl_err("failed to set regdomain: %d\n", ret);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ * Firmware will apply the regdomain change only after a scan is
|
|
|
+ * issued and it will send a WMI_REGDOMAIN_EVENTID when it has been
|
|
|
+ * changed.
|
|
|
+ */
|
|
|
+
|
|
|
+ for (i = 0; i < IEEE80211_NUM_BANDS; i++)
|
|
|
+ if (wiphy->bands[i])
|
|
|
+ rates[i] = (1 << wiphy->bands[i]->n_bitrates) - 1;
|
|
|
+
|
|
|
+
|
|
|
+ ret = ath6kl_wmi_beginscan_cmd(ar->wmi, 0, WMI_LONG_SCAN, false,
|
|
|
+ false, 0, ATH6KL_FG_SCAN_INTERVAL,
|
|
|
+ 0, NULL, false, rates);
|
|
|
+ if (ret) {
|
|
|
+ ath6kl_err("failed to start scan for a regdomain change: %d\n",
|
|
|
+ ret);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
static int ath6kl_cfg80211_vif_init(struct ath6kl_vif *vif)
|
|
|
{
|
|
|
vif->aggr_cntxt = aggr_init(vif);
|
|
@@ -3590,6 +3633,10 @@ int ath6kl_cfg80211_init(struct ath6kl *ar)
|
|
|
BIT(NL80211_IFTYPE_P2P_CLIENT);
|
|
|
}
|
|
|
|
|
|
+ if (config_enabled(CONFIG_ATH6KL_REGDOMAIN) &&
|
|
|
+ test_bit(ATH6KL_FW_CAPABILITY_REGDOMAIN, ar->fw_capabilities))
|
|
|
+ wiphy->reg_notifier = ath6kl_cfg80211_reg_notify;
|
|
|
+
|
|
|
/* max num of ssids that can be probed during scanning */
|
|
|
wiphy->max_scan_ssids = MAX_PROBED_SSIDS;
|
|
|
|