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

Commit 2a8b2d05 authored by Mihir Shete's avatar Mihir Shete Committed by Gerrit - the friendly Code Review server
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 b058dd78
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -421,6 +421,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)
{
@@ -2366,9 +2371,14 @@ __reg_process_hint_user(struct regulatory_request *user_request)
	 */
	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(user_request->alpha2))
		return REG_REQ_ALREADY_SET;