Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 930d6401 authored by Mihir Shete's avatar Mihir Shete
Browse files

cfg80211: unblock user hint when cfg80211_regdom is intersected



If the driver is loaded when cfg80211_regdom is intersected then
user hint will fail for the first time since cfg80211 does not
have a check to see if cfg80211_regdom is intersected. Add
a check to see if cf80211_regdom is intersected and allow the
user hint to be processed.

Change-Id: Iba9cdd32470e29d35d3bb35012eb404b7c78d601
CRs-Fixed: 639538
Signed-off-by: default avatarMihir Shete <smihir@codeaurora.org>
parent 27a70795
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -338,6 +338,11 @@ static bool is_user_regdom_saved(void)
	return true;
}

static bool is_cfg80211_regdom_intersected(void)
{
	return is_intersected_alpha2(get_cfg80211_regdom()->alpha2);
}

static const struct ieee80211_regdomain *
reg_copy_regd(const struct ieee80211_regdomain *src_regd)
{
@@ -1417,9 +1422,14 @@ get_reg_request_treatment(struct wiphy *wiphy,
		 */
		if ((lr->initiator == NL80211_REGDOM_SET_BY_CORE ||
		     lr->initiator == NL80211_REGDOM_SET_BY_DRIVER ||
		     lr->initiator == NL80211_REGDOM_SET_BY_USER) &&
		    regdom_changes(lr->alpha2))
		     lr->initiator == NL80211_REGDOM_SET_BY_USER)) {
			if (lr->intersect) {
				if (!is_cfg80211_regdom_intersected())
					return REG_REQ_IGNORE;
			} else if (regdom_changes(lr->alpha2)) {
				return REG_REQ_IGNORE;
			}
		}

		if (!regdom_changes(pending_request->alpha2))
			return REG_REQ_ALREADY_SET;