diff options
author | John W. Linville <linville@tuxdriver.com> | 2011-12-05 11:05:44 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-12-05 11:05:44 -0500 |
commit | cbec0627ef1adf7afa448e8bbae3146ce910212a (patch) | |
tree | 0a0956e19fb28c6eace2d445b1603afc2fd260ca /net | |
parent | f61759e6b831a55b89e584b198c3da325e2bc379 (diff) | |
parent | 9995ffe5f5fdddcc73e4465cc3f8b38714df8108 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/main.c | 6 | ||||
-rw-r--r-- | net/mac80211/util.c | 1 | ||||
-rw-r--r-- | net/wireless/reg.c | 49 |
3 files changed, 37 insertions, 19 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index d999bf3b84e1..cae443563ec9 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -757,6 +757,12 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
757 | if (!local->int_scan_req) | 757 | if (!local->int_scan_req) |
758 | return -ENOMEM; | 758 | return -ENOMEM; |
759 | 759 | ||
760 | for (band = 0; band < IEEE80211_NUM_BANDS; band++) { | ||
761 | if (!local->hw.wiphy->bands[band]) | ||
762 | continue; | ||
763 | local->int_scan_req->rates[band] = (u32) -1; | ||
764 | } | ||
765 | |||
760 | /* if low-level driver supports AP, we also support VLAN */ | 766 | /* if low-level driver supports AP, we also support VLAN */ |
761 | if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_AP)) { | 767 | if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_AP)) { |
762 | hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_AP_VLAN); | 768 | hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_AP_VLAN); |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index eca0fad09709..d5230ecc784d 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -1039,7 +1039,6 @@ int ieee80211_reconfig(struct ieee80211_local *local) | |||
1039 | struct ieee80211_sub_if_data, | 1039 | struct ieee80211_sub_if_data, |
1040 | u.ap); | 1040 | u.ap); |
1041 | 1041 | ||
1042 | memset(&sta->sta.drv_priv, 0, hw->sta_data_size); | ||
1043 | WARN_ON(drv_sta_add(local, sdata, &sta->sta)); | 1042 | WARN_ON(drv_sta_add(local, sdata, &sta->sta)); |
1044 | } | 1043 | } |
1045 | } | 1044 | } |
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 77e926738014..3302c56f60d1 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -57,8 +57,17 @@ | |||
57 | #define REG_DBG_PRINT(args...) | 57 | #define REG_DBG_PRINT(args...) |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | static struct regulatory_request core_request_world = { | ||
61 | .initiator = NL80211_REGDOM_SET_BY_CORE, | ||
62 | .alpha2[0] = '0', | ||
63 | .alpha2[1] = '0', | ||
64 | .intersect = false, | ||
65 | .processed = true, | ||
66 | .country_ie_env = ENVIRON_ANY, | ||
67 | }; | ||
68 | |||
60 | /* Receipt of information from last regulatory request */ | 69 | /* Receipt of information from last regulatory request */ |
61 | static struct regulatory_request *last_request; | 70 | static struct regulatory_request *last_request = &core_request_world; |
62 | 71 | ||
63 | /* To trigger userspace events */ | 72 | /* To trigger userspace events */ |
64 | static struct platform_device *reg_pdev; | 73 | static struct platform_device *reg_pdev; |
@@ -150,7 +159,7 @@ static char user_alpha2[2]; | |||
150 | module_param(ieee80211_regdom, charp, 0444); | 159 | module_param(ieee80211_regdom, charp, 0444); |
151 | MODULE_PARM_DESC(ieee80211_regdom, "IEEE 802.11 regulatory domain code"); | 160 | MODULE_PARM_DESC(ieee80211_regdom, "IEEE 802.11 regulatory domain code"); |
152 | 161 | ||
153 | static void reset_regdomains(void) | 162 | static void reset_regdomains(bool full_reset) |
154 | { | 163 | { |
155 | /* avoid freeing static information or freeing something twice */ | 164 | /* avoid freeing static information or freeing something twice */ |
156 | if (cfg80211_regdomain == cfg80211_world_regdom) | 165 | if (cfg80211_regdomain == cfg80211_world_regdom) |
@@ -165,6 +174,13 @@ static void reset_regdomains(void) | |||
165 | 174 | ||
166 | cfg80211_world_regdom = &world_regdom; | 175 | cfg80211_world_regdom = &world_regdom; |
167 | cfg80211_regdomain = NULL; | 176 | cfg80211_regdomain = NULL; |
177 | |||
178 | if (!full_reset) | ||
179 | return; | ||
180 | |||
181 | if (last_request != &core_request_world) | ||
182 | kfree(last_request); | ||
183 | last_request = &core_request_world; | ||
168 | } | 184 | } |
169 | 185 | ||
170 | /* | 186 | /* |
@@ -175,7 +191,7 @@ static void update_world_regdomain(const struct ieee80211_regdomain *rd) | |||
175 | { | 191 | { |
176 | BUG_ON(!last_request); | 192 | BUG_ON(!last_request); |
177 | 193 | ||
178 | reset_regdomains(); | 194 | reset_regdomains(false); |
179 | 195 | ||
180 | cfg80211_world_regdom = rd; | 196 | cfg80211_world_regdom = rd; |
181 | cfg80211_regdomain = rd; | 197 | cfg80211_regdomain = rd; |
@@ -1407,7 +1423,8 @@ static int __regulatory_hint(struct wiphy *wiphy, | |||
1407 | } | 1423 | } |
1408 | 1424 | ||
1409 | new_request: | 1425 | new_request: |
1410 | kfree(last_request); | 1426 | if (last_request != &core_request_world) |
1427 | kfree(last_request); | ||
1411 | 1428 | ||
1412 | last_request = pending_request; | 1429 | last_request = pending_request; |
1413 | last_request->intersect = intersect; | 1430 | last_request->intersect = intersect; |
@@ -1577,9 +1594,6 @@ static int regulatory_hint_core(const char *alpha2) | |||
1577 | { | 1594 | { |
1578 | struct regulatory_request *request; | 1595 | struct regulatory_request *request; |
1579 | 1596 | ||
1580 | kfree(last_request); | ||
1581 | last_request = NULL; | ||
1582 | |||
1583 | request = kzalloc(sizeof(struct regulatory_request), | 1597 | request = kzalloc(sizeof(struct regulatory_request), |
1584 | GFP_KERNEL); | 1598 | GFP_KERNEL); |
1585 | if (!request) | 1599 | if (!request) |
@@ -1777,7 +1791,7 @@ static void restore_regulatory_settings(bool reset_user) | |||
1777 | mutex_lock(&cfg80211_mutex); | 1791 | mutex_lock(&cfg80211_mutex); |
1778 | mutex_lock(®_mutex); | 1792 | mutex_lock(®_mutex); |
1779 | 1793 | ||
1780 | reset_regdomains(); | 1794 | reset_regdomains(true); |
1781 | restore_alpha2(alpha2, reset_user); | 1795 | restore_alpha2(alpha2, reset_user); |
1782 | 1796 | ||
1783 | /* | 1797 | /* |
@@ -2037,8 +2051,10 @@ static int __set_regdom(const struct ieee80211_regdomain *rd) | |||
2037 | } | 2051 | } |
2038 | 2052 | ||
2039 | request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx); | 2053 | request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx); |
2040 | if (!request_wiphy) { | 2054 | if (!request_wiphy && |
2041 | reg_set_request_processed(); | 2055 | (last_request->initiator == NL80211_REGDOM_SET_BY_DRIVER || |
2056 | last_request->initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE)) { | ||
2057 | schedule_delayed_work(®_timeout, 0); | ||
2042 | return -ENODEV; | 2058 | return -ENODEV; |
2043 | } | 2059 | } |
2044 | 2060 | ||
@@ -2046,7 +2062,7 @@ static int __set_regdom(const struct ieee80211_regdomain *rd) | |||
2046 | int r; | 2062 | int r; |
2047 | 2063 | ||
2048 | if (last_request->initiator != NL80211_REGDOM_SET_BY_DRIVER) { | 2064 | if (last_request->initiator != NL80211_REGDOM_SET_BY_DRIVER) { |
2049 | reset_regdomains(); | 2065 | reset_regdomains(false); |
2050 | cfg80211_regdomain = rd; | 2066 | cfg80211_regdomain = rd; |
2051 | return 0; | 2067 | return 0; |
2052 | } | 2068 | } |
@@ -2067,7 +2083,7 @@ static int __set_regdom(const struct ieee80211_regdomain *rd) | |||
2067 | if (r) | 2083 | if (r) |
2068 | return r; | 2084 | return r; |
2069 | 2085 | ||
2070 | reset_regdomains(); | 2086 | reset_regdomains(false); |
2071 | cfg80211_regdomain = rd; | 2087 | cfg80211_regdomain = rd; |
2072 | return 0; | 2088 | return 0; |
2073 | } | 2089 | } |
@@ -2092,7 +2108,7 @@ static int __set_regdom(const struct ieee80211_regdomain *rd) | |||
2092 | 2108 | ||
2093 | rd = NULL; | 2109 | rd = NULL; |
2094 | 2110 | ||
2095 | reset_regdomains(); | 2111 | reset_regdomains(false); |
2096 | cfg80211_regdomain = intersected_rd; | 2112 | cfg80211_regdomain = intersected_rd; |
2097 | 2113 | ||
2098 | return 0; | 2114 | return 0; |
@@ -2112,7 +2128,7 @@ static int __set_regdom(const struct ieee80211_regdomain *rd) | |||
2112 | kfree(rd); | 2128 | kfree(rd); |
2113 | rd = NULL; | 2129 | rd = NULL; |
2114 | 2130 | ||
2115 | reset_regdomains(); | 2131 | reset_regdomains(false); |
2116 | cfg80211_regdomain = intersected_rd; | 2132 | cfg80211_regdomain = intersected_rd; |
2117 | 2133 | ||
2118 | return 0; | 2134 | return 0; |
@@ -2265,11 +2281,8 @@ void /* __init_or_exit */ regulatory_exit(void) | |||
2265 | mutex_lock(&cfg80211_mutex); | 2281 | mutex_lock(&cfg80211_mutex); |
2266 | mutex_lock(®_mutex); | 2282 | mutex_lock(®_mutex); |
2267 | 2283 | ||
2268 | reset_regdomains(); | 2284 | reset_regdomains(true); |
2269 | |||
2270 | kfree(last_request); | ||
2271 | 2285 | ||
2272 | last_request = NULL; | ||
2273 | dev_set_uevent_suppress(®_pdev->dev, true); | 2286 | dev_set_uevent_suppress(®_pdev->dev, true); |
2274 | 2287 | ||
2275 | platform_device_unregister(reg_pdev); | 2288 | platform_device_unregister(reg_pdev); |