cfg80211: notify core hints that helps to restore regd settings
authorRajkumar Manoharan <rmanohar@qca.qualcomm.com>
Thu, 8 Dec 2011 18:29:26 +0000 (23:59 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 13 Dec 2011 20:31:04 +0000 (15:31 -0500)
Regulatory updates set by CORE are ignored for custom regulatory cards.
Let us notify the changes to the driver, as some drivers uses core hint
to restore its orig_* reg domain setting.

Cc: Paul Stewart <pstew@google.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/wireless/reg.c

index 70b171a52aeacdb686ac3a6a79c4997b85b0ec19..2f5b0505c95d59e9362bddf01432a1f2b2a50778 100644 (file)
@@ -1163,9 +1163,21 @@ void regulatory_update(struct wiphy *wiphy,
 static void update_all_wiphy_regulatory(enum nl80211_reg_initiator initiator)
 {
        struct cfg80211_registered_device *rdev;
+       struct wiphy *wiphy;
 
-       list_for_each_entry(rdev, &cfg80211_rdev_list, list)
-               wiphy_update_regulatory(&rdev->wiphy, initiator);
+       list_for_each_entry(rdev, &cfg80211_rdev_list, list) {
+               wiphy = &rdev->wiphy;
+               wiphy_update_regulatory(wiphy, initiator);
+               /*
+                * Regulatory updates set by CORE are ignored for custom
+                * regulatory cards. Let us notify the changes to the driver,
+                * as some drivers used this to restore its orig_* reg domain.
+                */
+               if (initiator == NL80211_REGDOM_SET_BY_CORE &&
+                   wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY &&
+                   wiphy->reg_notifier)
+                       wiphy->reg_notifier(wiphy, last_request);
+       }
 }
 
 static void handle_channel_custom(struct wiphy *wiphy,