From: Luis R. Rodriguez Date: Sat, 21 Feb 2009 05:04:32 +0000 (-0500) Subject: cfg80211: allow drivers that agree on regulatory to agree X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fff32c04f6074de0719cc46d8f488aaf746f151a;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git cfg80211: allow drivers that agree on regulatory to agree This allows drivers that agree on regulatory to share their regulatory domain. Signed-off-by: Luis R. Rodriguez Signed-off-by: John W. Linville --- diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 7ecb9033ad42..5456534bdf8c 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -1157,6 +1157,16 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by, return 0; return -EALREADY; } + + /* + * This would happen if you unplug and plug your card + * back in or if you add a new device for which the previously + * loaded card also agrees on the regulatory domain. + */ + if (last_request->initiator == REGDOM_SET_BY_DRIVER && + alpha2_equal(cfg80211_regdomain->alpha2, alpha2)) + return -EALREADY; + return REG_INTERSECT; case REGDOM_SET_BY_USER: if (last_request->initiator == REGDOM_SET_BY_COUNTRY_IE)