linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cfg80211/mac80211: apply station uAPSD parameters selectively
@ 2011-09-27 18:56 Johannes Berg
  0 siblings, 0 replies; only message in thread
From: Johannes Berg @ 2011-09-27 18:56 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, Eliad Peller

From: Johannes Berg <johannes.berg@intel.com>

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>
---
So it'd be possible to fix this much simpler by moving the code, but I'm
doing it like this for two reasons:

1) we might later want to implement TSPEC handling and allow them to
change
2) it adds the bitmap that others can build on in the future for other
parameters

 include/net/cfg80211.h |   12 ++++++++++++
 net/mac80211/cfg.c     |    6 ++++--
 net/wireless/nl80211.c |    2 ++
 3 files changed, 18 insertions(+), 2 deletions(-)

--- a/net/mac80211/cfg.c	2011-09-27 20:37:01.000000000 +0200
+++ b/net/mac80211/cfg.c	2011-09-27 20:37:55.000000000 +0200
@@ -714,8 +714,10 @@ static void sta_apply_parameters(struct
 	}
 	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
--- a/include/net/cfg80211.h	2011-09-27 20:37:00.000000000 +0200
+++ b/include/net/cfg80211.h	2011-09-27 20:37:55.000000000 +0200
@@ -424,6 +424,17 @@ enum plink_actions {
 };
 
 /**
+ * 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
  *
  * Used to change and create a new station.
@@ -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;
--- a/net/wireless/nl80211.c	2011-09-27 20:37:01.000000000 +0200
+++ b/net/wireless/nl80211.c	2011-09-27 20:37:55.000000000 +0200
@@ -2636,6 +2636,8 @@ static int nl80211_new_station(struct sk
 
 		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 &&



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-09-27 18:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-27 18:56 [PATCH] cfg80211/mac80211: apply station uAPSD parameters selectively Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).