|
@@ -1546,12 +1546,18 @@ static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev)
|
|
|
if (!wdev->beacon_interval)
|
|
|
goto out;
|
|
|
|
|
|
+ ret = cfg80211_reg_can_beacon(wiphy,
|
|
|
+ &wdev->chandef, wdev->iftype);
|
|
|
+ break;
|
|
|
+ case NL80211_IFTYPE_ADHOC:
|
|
|
+ if (!wdev->ssid_len)
|
|
|
+ goto out;
|
|
|
+
|
|
|
ret = cfg80211_reg_can_beacon(wiphy,
|
|
|
&wdev->chandef, wdev->iftype);
|
|
|
break;
|
|
|
case NL80211_IFTYPE_STATION:
|
|
|
case NL80211_IFTYPE_P2P_CLIENT:
|
|
|
- case NL80211_IFTYPE_ADHOC:
|
|
|
if (!wdev->current_bss ||
|
|
|
!wdev->current_bss->pub.channel)
|
|
|
goto out;
|
|
@@ -1907,7 +1913,7 @@ static enum reg_request_treatment
|
|
|
reg_process_hint_driver(struct wiphy *wiphy,
|
|
|
struct regulatory_request *driver_request)
|
|
|
{
|
|
|
- const struct ieee80211_regdomain *regd;
|
|
|
+ const struct ieee80211_regdomain *regd, *tmp;
|
|
|
enum reg_request_treatment treatment;
|
|
|
|
|
|
treatment = __reg_process_hint_driver(driver_request);
|
|
@@ -1927,7 +1933,10 @@ reg_process_hint_driver(struct wiphy *wiphy,
|
|
|
reg_free_request(driver_request);
|
|
|
return REG_REQ_IGNORE;
|
|
|
}
|
|
|
+
|
|
|
+ tmp = get_wiphy_regdom(wiphy);
|
|
|
rcu_assign_pointer(wiphy->regd, regd);
|
|
|
+ rcu_free_regdom(tmp);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1986,11 +1995,8 @@ __reg_process_hint_country_ie(struct wiphy *wiphy,
|
|
|
return REG_REQ_IGNORE;
|
|
|
return REG_REQ_ALREADY_SET;
|
|
|
}
|
|
|
- /*
|
|
|
- * Two consecutive Country IE hints on the same wiphy.
|
|
|
- * This should be picked up early by the driver/stack
|
|
|
- */
|
|
|
- if (WARN_ON(regdom_changes(country_ie_request->alpha2)))
|
|
|
+
|
|
|
+ if (regdom_changes(country_ie_request->alpha2))
|
|
|
return REG_REQ_OK;
|
|
|
return REG_REQ_ALREADY_SET;
|
|
|
}
|