aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-05-11 14:57:56 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-13 15:44:35 -0400
commiteccb8e8f0c3af47aeb6dbe4012eb8d4fc888767a (patch)
tree3705a833e4a5efb08beb2bfc4175775171e74295 /net/mac80211/cfg.c
parent0e46724a48fcc3bac1fecea413d20af64a75844f (diff)
nl80211: improve station flags handling
It is currently not possible to modify station flags, but that capability would be very useful. This patch introduces a new nl80211 attribute that contains a set/mask for station flags, and updates the internal API (and mac80211) to mirror that. The new attribute is parsed before falling back to the old so that userspace can specify both (if it can) to work on all kernels. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
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