Jesse Keating 2f82dda
From: Stanislaw Gruszka <sgruszka@redhat.com>
Jesse Keating 2f82dda
To: kernel@lists.fedoraproject.org, "John W. Linville" <linville@redhat.com>
Jesse Keating 2f82dda
Subject: [PATCH 1/4 2.6.32.y] mac80211: explicitly disable/enable QoS
Jesse Keating 2f82dda
Date: Fri, 11 Jun 2010 17:03:13 +0200
Jesse Keating 2f82dda
Jesse Keating 2f82dda
Add interface to disable/enable QoS (aka WMM or WME). Currently drivers
Jesse Keating 2f82dda
enable it explicitly when ->conf_tx method is called, and newer disable.
Jesse Keating 2f82dda
Disabling is needed for some APs, which do not support QoS, such
Jesse Keating 2f82dda
we should send QoS frames to them.
Jesse Keating 2f82dda
Jesse Keating 2f82dda
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Jesse Keating 2f82dda
---
Jesse Keating 2f82dda
 include/net/mac80211.h |    5 +++++
Jesse Keating 2f82dda
 net/mac80211/mlme.c    |    9 ++++++++-
Jesse Keating 2f82dda
 net/mac80211/util.c    |    5 +++++
Jesse Keating 2f82dda
 3 files changed, 18 insertions(+), 1 deletions(-)
Jesse Keating 2f82dda
Jesse Keating 2f82dda
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
Jesse Keating 2f82dda
index c39ed07..de904fc 100644
Jesse Keating 2f82dda
--- a/include/net/mac80211.h
Jesse Keating 2f82dda
+++ b/include/net/mac80211.h
Jesse Keating 2f82dda
@@ -572,11 +572,15 @@ struct ieee80211_rx_status {
Jesse Keating 2f82dda
  *	may turn the device off as much as possible. Typically, this flag will
Jesse Keating 2f82dda
  *	be set when an interface is set UP but not associated or scanning, but
Jesse Keating 2f82dda
  *	it can also be unset in that case when monitor interfaces are active.
Jesse Keating 2f82dda
+ * @IEEE80211_CONF_QOS: Enable 802.11e QoS also know as WMM (Wireless
Jesse Keating 2f82dda
+ *      Multimedia). On some drivers (iwlwifi is one of know) we have
Jesse Keating 2f82dda
+ *      to enable/disable QoS explicitly.
Jesse Keating 2f82dda
  */
Jesse Keating 2f82dda
 enum ieee80211_conf_flags {
Jesse Keating 2f82dda
 	IEEE80211_CONF_RADIOTAP		= (1<<0),
Jesse Keating 2f82dda
 	IEEE80211_CONF_PS		= (1<<1),
Jesse Keating 2f82dda
 	IEEE80211_CONF_IDLE		= (1<<2),
Jesse Keating 2f82dda
+	IEEE80211_CONF_QOS		= (1<<3),
Jesse Keating 2f82dda
 };
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
@@ -599,6 +603,7 @@ enum ieee80211_conf_changed {
Jesse Keating 2f82dda
 	IEEE80211_CONF_CHANGE_CHANNEL		= BIT(6),
Jesse Keating 2f82dda
 	IEEE80211_CONF_CHANGE_RETRY_LIMITS	= BIT(7),
Jesse Keating 2f82dda
 	IEEE80211_CONF_CHANGE_IDLE		= BIT(8),
Jesse Keating 2f82dda
+	IEEE80211_CONF_CHANGE_QOS		= BIT(9),
Jesse Keating 2f82dda
 };
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 /**
Jesse Keating 2f82dda
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
Jesse Keating 2f82dda
index 4a15df1..d3950b7 100644
Jesse Keating 2f82dda
--- a/net/mac80211/mlme.c
Jesse Keating 2f82dda
+++ b/net/mac80211/mlme.c
Jesse Keating 2f82dda
@@ -786,6 +786,9 @@ static void ieee80211_sta_wmm_params(struct ieee80211_local *local,
Jesse Keating 2f82dda
 	int count;
Jesse Keating 2f82dda
 	u8 *pos;
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
+	if (!local->ops->conf_tx)
Jesse Keating 2f82dda
+		return;
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
 	if (!(ifmgd->flags & IEEE80211_STA_WMM_ENABLED))
Jesse Keating 2f82dda
 		return;
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
@@ -844,11 +847,15 @@ static void ieee80211_sta_wmm_params(struct ieee80211_local *local,
Jesse Keating 2f82dda
 		       wiphy_name(local->hw.wiphy), queue, aci, acm,
Jesse Keating 2f82dda
 		       params.aifs, params.cw_min, params.cw_max, params.txop);
Jesse Keating 2f82dda
 #endif
Jesse Keating 2f82dda
-		if (drv_conf_tx(local, queue, &params) && local->ops->conf_tx)
Jesse Keating 2f82dda
+		if (drv_conf_tx(local, queue, &params))
Jesse Keating 2f82dda
 			printk(KERN_DEBUG "%s: failed to set TX queue "
Jesse Keating 2f82dda
 			       "parameters for queue %d\n",
Jesse Keating 2f82dda
 			       wiphy_name(local->hw.wiphy), queue);
Jesse Keating 2f82dda
 	}
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+	/* enable WMM or activate new settings */
Jesse Keating 2f82dda
+	local->hw.conf.flags |=	IEEE80211_CONF_QOS;
Jesse Keating 2f82dda
+	drv_config(local, IEEE80211_CONF_CHANGE_QOS);
Jesse Keating 2f82dda
 }
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 static u32 ieee80211_handle_bss_capability(struct ieee80211_sub_if_data *sdata,
Jesse Keating 2f82dda
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
Jesse Keating 2f82dda
index 31b1085..21f11cc 100644
Jesse Keating 2f82dda
--- a/net/mac80211/util.c
Jesse Keating 2f82dda
+++ b/net/mac80211/util.c
Jesse Keating 2f82dda
@@ -791,6 +791,11 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata)
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 		drv_conf_tx(local, queue, &qparam);
Jesse Keating 2f82dda
 	}
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+	/* after reinitialize QoS TX queues setting to default,
Jesse Keating 2f82dda
+	 * disable QoS at all */
Jesse Keating 2f82dda
+	local->hw.conf.flags &=	~IEEE80211_CONF_QOS;
Jesse Keating 2f82dda
+	drv_config(local, IEEE80211_CONF_CHANGE_QOS);
Jesse Keating 2f82dda
 }
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
Jesse Keating 2f82dda
-- 
Jesse Keating 2f82dda
1.6.2.5
Jesse Keating 2f82dda
Jesse Keating 2f82dda
_______________________________________________
Jesse Keating 2f82dda
kernel mailing list
Jesse Keating 2f82dda
kernel@lists.fedoraproject.org
Jesse Keating 2f82dda
https://admin.fedoraproject.org/mailman/listinfo/kernel
Jesse Keating 2f82dda