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.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index be86e159e6ef..d591a936f5c4 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -629,34 +629,38 @@ static void sta_apply_parameters(struct ieee80211_local *local,
629 int i, j; 629 int i, j;
630 struct ieee80211_supported_band *sband; 630 struct ieee80211_supported_band *sband;
631 struct ieee80211_sub_if_data *sdata = sta->sdata; 631 struct ieee80211_sub_if_data *sdata = sta->sdata;
632 u32 mask, set;
632 633
633 sband = local->hw.wiphy->bands[local->oper_channel->band]; 634 sband = local->hw.wiphy->bands[local->oper_channel->band];
634 635
635 /* 636 spin_lock_bh(&sta->lock);
636 * FIXME: updating the flags is racy when this function is 637 mask = params->sta_flags_mask;
637 * called from ieee80211_change_station(), this will 638 set = params->sta_flags_set;
638 * be resolved in a future patch.
639 */
640 639
641 if (params->station_flags & STATION_FLAG_CHANGED) { 640 if (mask & BIT(NL80211_STA_FLAG_AUTHORIZED)) {
642 spin_lock_bh(&sta->lock);
643 sta->flags &= ~WLAN_STA_AUTHORIZED; 641 sta->flags &= ~WLAN_STA_AUTHORIZED;
644 if (params->station_flags & STATION_FLAG_AUTHORIZED) 642 if (set & BIT(NL80211_STA_FLAG_AUTHORIZED))
645 sta->flags |= WLAN_STA_AUTHORIZED; 643 sta->flags |= WLAN_STA_AUTHORIZED;
644 }
646 645
646 if (mask & BIT(NL80211_STA_FLAG_SHORT_PREAMBLE)) {
647 sta->flags &= ~WLAN_STA_SHORT_PREAMBLE; 647 sta->flags &= ~WLAN_STA_SHORT_PREAMBLE;
648 if (params->station_flags & STATION_FLAG_SHORT_PREAMBLE) 648 if (set & BIT(NL80211_STA_FLAG_SHORT_PREAMBLE))
649 sta->flags |= WLAN_STA_SHORT_PREAMBLE; 649 sta->flags |= WLAN_STA_SHORT_PREAMBLE;
650 }
650 651
652 if (mask & BIT(NL80211_STA_FLAG_WME)) {
651 sta->flags &= ~WLAN_STA_WME; 653 sta->flags &= ~WLAN_STA_WME;
652 if (params->station_flags & STATION_FLAG_WME) 654 if (set & BIT(NL80211_STA_FLAG_WME))
653 sta->flags |= WLAN_STA_WME; 655 sta->flags |= WLAN_STA_WME;
656 }
654 657
658 if (mask & BIT(NL80211_STA_FLAG_MFP)) {
655 sta->flags &= ~WLAN_STA_MFP; 659 sta->flags &= ~WLAN_STA_MFP;
656 if (params->station_flags & STATION_FLAG_MFP) 660 if (set & BIT(NL80211_STA_FLAG_MFP))
657 sta->flags |= WLAN_STA_MFP; 661 sta->flags |= WLAN_STA_MFP;
658 spin_unlock_bh(&sta->lock);
659 } 662 }
663 spin_unlock_bh(&sta->lock);
660 664
661 /* 665 /*
662 * FIXME: updating the following information is racy when this 666 * FIXME: updating the following information is racy when this