aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c97
1 files changed, 47 insertions, 50 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index dd4ff36c557a..e4dd2fc34de3 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -24,6 +24,7 @@
24 24
25static struct wireless_dev *ieee80211_add_iface(struct wiphy *wiphy, 25static struct wireless_dev *ieee80211_add_iface(struct wiphy *wiphy,
26 const char *name, 26 const char *name,
27 unsigned char name_assign_type,
27 enum nl80211_iftype type, 28 enum nl80211_iftype type,
28 u32 *flags, 29 u32 *flags,
29 struct vif_params *params) 30 struct vif_params *params)
@@ -33,7 +34,7 @@ static struct wireless_dev *ieee80211_add_iface(struct wiphy *wiphy,
33 struct ieee80211_sub_if_data *sdata; 34 struct ieee80211_sub_if_data *sdata;
34 int err; 35 int err;
35 36
36 err = ieee80211_if_add(local, name, &wdev, type, params); 37 err = ieee80211_if_add(local, name, name_assign_type, &wdev, type, params);
37 if (err) 38 if (err)
38 return ERR_PTR(err); 39 return ERR_PTR(err);
39 40
@@ -977,6 +978,14 @@ static int sta_apply_auth_flags(struct ieee80211_local *local,
977 if (mask & BIT(NL80211_STA_FLAG_ASSOCIATED) && 978 if (mask & BIT(NL80211_STA_FLAG_ASSOCIATED) &&
978 set & BIT(NL80211_STA_FLAG_ASSOCIATED) && 979 set & BIT(NL80211_STA_FLAG_ASSOCIATED) &&
979 !test_sta_flag(sta, WLAN_STA_ASSOC)) { 980 !test_sta_flag(sta, WLAN_STA_ASSOC)) {
981 /*
982 * When peer becomes associated, init rate control as
983 * well. Some drivers require rate control initialized
984 * before drv_sta_state() is called.
985 */
986 if (test_sta_flag(sta, WLAN_STA_TDLS_PEER))
987 rate_control_rate_init(sta);
988
980 ret = sta_info_move_state(sta, IEEE80211_STA_ASSOC); 989 ret = sta_info_move_state(sta, IEEE80211_STA_ASSOC);
981 if (ret) 990 if (ret)
982 return ret; 991 return ret;
@@ -1050,6 +1059,10 @@ static int sta_apply_parameters(struct ieee80211_local *local,
1050 } 1059 }
1051 } 1060 }
1052 1061
1062 if (mask & BIT(NL80211_STA_FLAG_WME) &&
1063 local->hw.queues >= IEEE80211_NUM_ACS)
1064 sta->sta.wme = set & BIT(NL80211_STA_FLAG_WME);
1065
1053 /* auth flags will be set later for TDLS stations */ 1066 /* auth flags will be set later for TDLS stations */
1054 if (!test_sta_flag(sta, WLAN_STA_TDLS_PEER)) { 1067 if (!test_sta_flag(sta, WLAN_STA_TDLS_PEER)) {
1055 ret = sta_apply_auth_flags(local, sta, mask, set); 1068 ret = sta_apply_auth_flags(local, sta, mask, set);
@@ -1064,10 +1077,8 @@ static int sta_apply_parameters(struct ieee80211_local *local,
1064 clear_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE); 1077 clear_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE);
1065 } 1078 }
1066 1079
1067 if (mask & BIT(NL80211_STA_FLAG_WME))
1068 sta->sta.wme = set & BIT(NL80211_STA_FLAG_WME);
1069
1070 if (mask & BIT(NL80211_STA_FLAG_MFP)) { 1080 if (mask & BIT(NL80211_STA_FLAG_MFP)) {
1081 sta->sta.mfp = !!(set & BIT(NL80211_STA_FLAG_MFP));
1071 if (set & BIT(NL80211_STA_FLAG_MFP)) 1082 if (set & BIT(NL80211_STA_FLAG_MFP))
1072 set_sta_flag(sta, WLAN_STA_MFP); 1083 set_sta_flag(sta, WLAN_STA_MFP);
1073 else 1084 else
@@ -1377,11 +1388,6 @@ static int ieee80211_change_station(struct wiphy *wiphy,
1377 if (err) 1388 if (err)
1378 goto out_err; 1389 goto out_err;
1379 1390
1380 /* When peer becomes authorized, init rate control as well */
1381 if (test_sta_flag(sta, WLAN_STA_TDLS_PEER) &&
1382 test_sta_flag(sta, WLAN_STA_AUTHORIZED))
1383 rate_control_rate_init(sta);
1384
1385 mutex_unlock(&local->sta_mtx); 1391 mutex_unlock(&local->sta_mtx);
1386 1392
1387 if ((sdata->vif.type == NL80211_IFTYPE_AP || 1393 if ((sdata->vif.type == NL80211_IFTYPE_AP ||
@@ -2273,7 +2279,6 @@ int __ieee80211_request_smps_ap(struct ieee80211_sub_if_data *sdata,
2273{ 2279{
2274 struct sta_info *sta; 2280 struct sta_info *sta;
2275 enum ieee80211_smps_mode old_req; 2281 enum ieee80211_smps_mode old_req;
2276 int i;
2277 2282
2278 if (WARN_ON_ONCE(sdata->vif.type != NL80211_IFTYPE_AP)) 2283 if (WARN_ON_ONCE(sdata->vif.type != NL80211_IFTYPE_AP))
2279 return -EINVAL; 2284 return -EINVAL;
@@ -2297,52 +2302,44 @@ int __ieee80211_request_smps_ap(struct ieee80211_sub_if_data *sdata,
2297 } 2302 }
2298 2303
2299 ht_dbg(sdata, 2304 ht_dbg(sdata,
2300 "SMSP %d requested in AP mode, sending Action frame to %d stations\n", 2305 "SMPS %d requested in AP mode, sending Action frame to %d stations\n",
2301 smps_mode, atomic_read(&sdata->u.ap.num_mcast_sta)); 2306 smps_mode, atomic_read(&sdata->u.ap.num_mcast_sta));
2302 2307
2303 mutex_lock(&sdata->local->sta_mtx); 2308 mutex_lock(&sdata->local->sta_mtx);
2304 for (i = 0; i < STA_HASH_SIZE; i++) { 2309 list_for_each_entry(sta, &sdata->local->sta_list, list) {
2305 for (sta = rcu_dereference_protected(sdata->local->sta_hash[i], 2310 /*
2306 lockdep_is_held(&sdata->local->sta_mtx)); 2311 * Only stations associated to our AP and
2307 sta; 2312 * associated VLANs
2308 sta = rcu_dereference_protected(sta->hnext, 2313 */
2309 lockdep_is_held(&sdata->local->sta_mtx))) { 2314 if (sta->sdata->bss != &sdata->u.ap)
2310 /* 2315 continue;
2311 * Only stations associated to our AP and
2312 * associated VLANs
2313 */
2314 if (sta->sdata->bss != &sdata->u.ap)
2315 continue;
2316 2316
2317 /* This station doesn't support MIMO - skip it */ 2317 /* This station doesn't support MIMO - skip it */
2318 if (sta_info_tx_streams(sta) == 1) 2318 if (sta_info_tx_streams(sta) == 1)
2319 continue; 2319 continue;
2320 2320
2321 /* 2321 /*
2322 * Don't wake up a STA just to send the action frame 2322 * Don't wake up a STA just to send the action frame
2323 * unless we are getting more restrictive. 2323 * unless we are getting more restrictive.
2324 */ 2324 */
2325 if (test_sta_flag(sta, WLAN_STA_PS_STA) && 2325 if (test_sta_flag(sta, WLAN_STA_PS_STA) &&
2326 !ieee80211_smps_is_restrictive(sta->known_smps_mode, 2326 !ieee80211_smps_is_restrictive(sta->known_smps_mode,
2327 smps_mode)) { 2327 smps_mode)) {
2328 ht_dbg(sdata, 2328 ht_dbg(sdata, "Won't send SMPS to sleeping STA %pM\n",
2329 "Won't send SMPS to sleeping STA %pM\n", 2329 sta->sta.addr);
2330 sta->sta.addr); 2330 continue;
2331 continue; 2331 }
2332 }
2333 2332
2334 /* 2333 /*
2335 * If the STA is not authorized, wait until it gets 2334 * If the STA is not authorized, wait until it gets
2336 * authorized and the action frame will be sent then. 2335 * authorized and the action frame will be sent then.
2337 */ 2336 */
2338 if (!test_sta_flag(sta, WLAN_STA_AUTHORIZED)) 2337 if (!test_sta_flag(sta, WLAN_STA_AUTHORIZED))
2339 continue; 2338 continue;
2340 2339
2341 ht_dbg(sdata, "Sending SMPS to %pM\n", sta->sta.addr); 2340 ht_dbg(sdata, "Sending SMPS to %pM\n", sta->sta.addr);
2342 ieee80211_send_smps_action(sdata, smps_mode, 2341 ieee80211_send_smps_action(sdata, smps_mode, sta->sta.addr,
2343 sta->sta.addr, 2342 sdata->vif.bss_conf.bssid);
2344 sdata->vif.bss_conf.bssid);
2345 }
2346 } 2343 }
2347 mutex_unlock(&sdata->local->sta_mtx); 2344 mutex_unlock(&sdata->local->sta_mtx);
2348 2345
@@ -3581,7 +3578,7 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev,
3581 nullfunc->qos_ctrl = cpu_to_le16(7); 3578 nullfunc->qos_ctrl = cpu_to_le16(7);
3582 3579
3583 local_bh_disable(); 3580 local_bh_disable();
3584 ieee80211_xmit(sdata, skb); 3581 ieee80211_xmit(sdata, sta, skb);
3585 local_bh_enable(); 3582 local_bh_enable();
3586 rcu_read_unlock(); 3583 rcu_read_unlock();
3587 3584