cfg80211: allow drivers that agree on regulatory to agree
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Sat, 21 Feb 2009 05:04:32 +0000 (00:04 -0500)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 27 Feb 2009 19:52:58 +0000 (14:52 -0500)
This allows drivers that agree on regulatory to share their
regulatory domain.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/wireless/reg.c

index 7ecb9033ad42448e64d9597554101b33246cfc18..5456534bdf8cc5f37ae1f808acc489fa2e7fbbe7 100644 (file)
@@ -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)