diff mbox

cfg80211: Fix regulatory bug with multiple cards with a delayed CRDA response

Message ID 1289528843-21982-1-git-send-email-lrodriguez@atheros.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Luis Rodriguez Nov. 12, 2010, 2:27 a.m. UTC
None
diff mbox

Patch

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 3be18d9..ecac993 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1281,9 +1281,13 @@  static int ignore_request(struct wiphy *wiphy,
 		 * 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.
+		 * This can also happen if you have two cards both with the
+		 * same regulatory domain and CRDA hasn't yet replied back
+		 * with the last request's regulatory domain.
 		 */
 		if (last_request->initiator == NL80211_REGDOM_SET_BY_DRIVER &&
-		    !regdom_changes(pending_request->alpha2))
+		    (!regdom_changes(pending_request->alpha2) ||
+		     alpha2_equal(last_request->alpha2, pending_request->alpha2)))
 			return -EALREADY;
 
 		return REG_INTERSECT;