]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
cfg80211/mac80211: apply station uAPSD parameters selectively
authorJohannes Berg <johannes.berg@intel.com>
Tue, 27 Sep 2011 18:56:12 +0000 (20:56 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 30 Sep 2011 19:57:03 +0000 (15:57 -0400)
Currently, when hostapd sets the station as authorized
we also overwrite its uAPSD parameter. This obviously
leads to buggy behaviour (later, with my patches that
actually add uAPSD support). To fix this, only apply
those parameters if they were actually set in nl80211,
and to achieve that add a bitmap of things to apply.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
include/net/cfg80211.h
net/mac80211/cfg.c
net/wireless/nl80211.c

index 31d823a3092b43f6a4e9c9904ce2512e034aa71c..34b8f269976b72c2c139cf6d81fd76479ad43f37 100644 (file)
@@ -423,6 +423,17 @@ enum plink_actions {
        PLINK_ACTION_BLOCK,
 };
 
+/**
+ * enum station_parameters_apply_mask - station parameter values to apply
+ * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp)
+ *
+ * Not all station parameters have in-band "no change" signalling,
+ * for those that don't these flags will are used.
+ */
+enum station_parameters_apply_mask {
+       STATION_PARAM_APPLY_UAPSD = BIT(0),
+};
+
 /**
  * struct station_parameters - station parameters
  *
@@ -450,6 +461,7 @@ struct station_parameters {
        u8 *supported_rates;
        struct net_device *vlan;
        u32 sta_flags_mask, sta_flags_set;
+       u32 sta_modify_mask;
        int listen_interval;
        u16 aid;
        u8 supported_rates_len;
index 8fef3cddbc4fd927957257512125959d272a467e..13061ebc93efdef87a8aca62998e6c26c9b70ac0 100644 (file)
@@ -714,8 +714,10 @@ static void sta_apply_parameters(struct ieee80211_local *local,
        }
        spin_unlock_irqrestore(&sta->flaglock, flags);
 
-       sta->sta.uapsd_queues = params->uapsd_queues;
-       sta->sta.max_sp = params->max_sp;
+       if (params->sta_modify_mask & STATION_PARAM_APPLY_UAPSD) {
+               sta->sta.uapsd_queues = params->uapsd_queues;
+               sta->sta.max_sp = params->max_sp;
+       }
 
        /*
         * cfg80211 validates this (1-2007) and allows setting the AID
index b85075761e2422eaa2f8f2170501359b3e400bab..3799623e7f465ca5789f48588be467f26d9da186 100644 (file)
@@ -2643,6 +2643,8 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
 
                if (params.max_sp & ~IEEE80211_WMM_IE_STA_QOSINFO_SP_MASK)
                        return -EINVAL;
+
+               params.sta_modify_mask |= STATION_PARAM_APPLY_UAPSD;
        }
 
        if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&