diff options
-rw-r--r-- | net/wireless/reg.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 481caafc6ba5..c45c8b772ddd 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -1792,6 +1792,26 @@ static void restore_alpha2(char *alpha2, bool reset_user) | |||
1792 | REG_DBG_PRINT("Restoring regulatory settings\n"); | 1792 | REG_DBG_PRINT("Restoring regulatory settings\n"); |
1793 | } | 1793 | } |
1794 | 1794 | ||
1795 | static void restore_custom_reg_settings(struct wiphy *wiphy) | ||
1796 | { | ||
1797 | struct ieee80211_supported_band *sband; | ||
1798 | enum ieee80211_band band; | ||
1799 | struct ieee80211_channel *chan; | ||
1800 | int i; | ||
1801 | |||
1802 | for (band = 0; band < IEEE80211_NUM_BANDS; band++) { | ||
1803 | sband = wiphy->bands[band]; | ||
1804 | if (!sband) | ||
1805 | continue; | ||
1806 | for (i = 0; i < sband->n_channels; i++) { | ||
1807 | chan = &sband->channels[i]; | ||
1808 | chan->flags = chan->orig_flags; | ||
1809 | chan->max_antenna_gain = chan->orig_mag; | ||
1810 | chan->max_power = chan->orig_mpwr; | ||
1811 | } | ||
1812 | } | ||
1813 | } | ||
1814 | |||
1795 | /* | 1815 | /* |
1796 | * Restoring regulatory settings involves ingoring any | 1816 | * Restoring regulatory settings involves ingoring any |
1797 | * possibly stale country IE information and user regulatory | 1817 | * possibly stale country IE information and user regulatory |
@@ -1813,6 +1833,7 @@ static void restore_regulatory_settings(bool reset_user) | |||
1813 | struct reg_beacon *reg_beacon, *btmp; | 1833 | struct reg_beacon *reg_beacon, *btmp; |
1814 | struct regulatory_request *reg_request, *tmp; | 1834 | struct regulatory_request *reg_request, *tmp; |
1815 | LIST_HEAD(tmp_reg_req_list); | 1835 | LIST_HEAD(tmp_reg_req_list); |
1836 | struct cfg80211_registered_device *rdev; | ||
1816 | 1837 | ||
1817 | mutex_lock(&cfg80211_mutex); | 1838 | mutex_lock(&cfg80211_mutex); |
1818 | mutex_lock(®_mutex); | 1839 | mutex_lock(®_mutex); |
@@ -1861,6 +1882,11 @@ static void restore_regulatory_settings(bool reset_user) | |||
1861 | /* First restore to the basic regulatory settings */ | 1882 | /* First restore to the basic regulatory settings */ |
1862 | cfg80211_regdomain = cfg80211_world_regdom; | 1883 | cfg80211_regdomain = cfg80211_world_regdom; |
1863 | 1884 | ||
1885 | list_for_each_entry(rdev, &cfg80211_rdev_list, list) { | ||
1886 | if (rdev->wiphy.flags & WIPHY_FLAG_CUSTOM_REGULATORY) | ||
1887 | restore_custom_reg_settings(&rdev->wiphy); | ||
1888 | } | ||
1889 | |||
1864 | mutex_unlock(®_mutex); | 1890 | mutex_unlock(®_mutex); |
1865 | mutex_unlock(&cfg80211_mutex); | 1891 | mutex_unlock(&cfg80211_mutex); |
1866 | 1892 | ||