Return-path: Received: from bombadil.infradead.org ([18.85.46.34]:56077 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751194AbZBUFEn (ORCPT ); Sat, 21 Feb 2009 00:04:43 -0500 From: "Luis R. Rodriguez" To: linville@tuxdriver.com, johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, "Luis R. Rodriguez" Subject: [PATCH v6 14/15] cfg80211: allow drivers that agree on regulatory to agree Date: Sat, 21 Feb 2009 00:04:32 -0500 Message-Id: <1235192673-6314-15-git-send-email-lrodriguez@atheros.com> (sfid-20090221_062317_670018_99E34FEB) In-Reply-To: <1235192673-6314-1-git-send-email-lrodriguez@atheros.com> References: <1235192673-6314-1-git-send-email-lrodriguez@atheros.com> Sender: linux-wireless-owner@vger.kernel.org List-ID: This allows drivers that agree on regulatory to share their regulatory domain. Signed-off-by: Luis R. Rodriguez --- net/wireless/reg.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 7ecb903..5456534 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) -- 1.6.0.3