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