aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2010-07-19 10:39:04 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-07-20 16:02:58 -0400
commit4ced3f74dae18715920cb680098ec7ff4345d0a3 (patch)
tree4a1b35285921fb25e01363af48a8c7db7423098d
parent875ae5f68883c75aad826e715df8ec0619551a07 (diff)
mac80211: move QoS-enable to BSS info
Ever since commit e1b3ec1a2a336c328c336cfa5485a5f0484cc90d Author: Stanislaw Gruszka <sgruszka@redhat.com> Date: Mon Mar 29 12:18:34 2010 +0200 mac80211: explicitly disable/enable QoS mac80211 is telling drivers, in particular iwlwifi, whether QoS is enabled or not. However, this is only relevant for station mode, since only then will any device send nullfunc frames and need to know whether they should be QoS frames or not. In other modes, there are (currently) no frames the device is supposed to send. When you now consider virtual interfaces, it becomes apparent that the current mechanism is inadequate since it enables/disables QoS on a global scale, where for nullfunc frames it has to be on a per-interface scale. Due to the above considerations, we can change the way mac80211 advertises the QoS state to drivers to only ever advertise it as "off" in station mode, and make it a per-BSS setting. Tested-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c18
-rw-r--r--include/net/mac80211.h11
-rw-r--r--net/mac80211/cfg.c4
-rw-r--r--net/mac80211/mlme.c11
-rw-r--r--net/mac80211/util.c7
5 files changed, 24 insertions, 27 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index f73eb08a9494..676d49df77ed 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1763,6 +1763,15 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw,
1763 1763
1764 mutex_lock(&priv->mutex); 1764 mutex_lock(&priv->mutex);
1765 1765
1766 if (changes & BSS_CHANGED_QOS) {
1767 unsigned long flags;
1768
1769 spin_lock_irqsave(&priv->lock, flags);
1770 priv->qos_data.qos_active = bss_conf->qos;
1771 iwl_update_qos(priv);
1772 spin_unlock_irqrestore(&priv->lock, flags);
1773 }
1774
1766 if (changes & BSS_CHANGED_BEACON && vif->type == NL80211_IFTYPE_AP) { 1775 if (changes & BSS_CHANGED_BEACON && vif->type == NL80211_IFTYPE_AP) {
1767 dev_kfree_skb(priv->ibss_beacon); 1776 dev_kfree_skb(priv->ibss_beacon);
1768 priv->ibss_beacon = ieee80211_beacon_get(hw, vif); 1777 priv->ibss_beacon = ieee80211_beacon_get(hw, vif);
@@ -2134,15 +2143,6 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
2134 iwl_set_tx_power(priv, conf->power_level, false); 2143 iwl_set_tx_power(priv, conf->power_level, false);
2135 } 2144 }
2136 2145
2137 if (changed & IEEE80211_CONF_CHANGE_QOS) {
2138 bool qos_active = !!(conf->flags & IEEE80211_CONF_QOS);
2139
2140 spin_lock_irqsave(&priv->lock, flags);
2141 priv->qos_data.qos_active = qos_active;
2142 iwl_update_qos(priv);
2143 spin_unlock_irqrestore(&priv->lock, flags);
2144 }
2145
2146 if (!iwl_is_ready(priv)) { 2146 if (!iwl_is_ready(priv)) {
2147 IWL_DEBUG_MAC80211(priv, "leave - not ready\n"); 2147 IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
2148 goto out; 2148 goto out;
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 7f256e23c57f..20d372edec29 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -147,6 +147,8 @@ struct ieee80211_low_level_stats {
147 * @BSS_CHANGED_CQM: Connection quality monitor config changed 147 * @BSS_CHANGED_CQM: Connection quality monitor config changed
148 * @BSS_CHANGED_IBSS: IBSS join status changed 148 * @BSS_CHANGED_IBSS: IBSS join status changed
149 * @BSS_CHANGED_ARP_FILTER: Hardware ARP filter address list or state changed. 149 * @BSS_CHANGED_ARP_FILTER: Hardware ARP filter address list or state changed.
150 * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note
151 * that it is only ever disabled for station mode.
150 */ 152 */
151enum ieee80211_bss_change { 153enum ieee80211_bss_change {
152 BSS_CHANGED_ASSOC = 1<<0, 154 BSS_CHANGED_ASSOC = 1<<0,
@@ -162,6 +164,7 @@ enum ieee80211_bss_change {
162 BSS_CHANGED_CQM = 1<<10, 164 BSS_CHANGED_CQM = 1<<10,
163 BSS_CHANGED_IBSS = 1<<11, 165 BSS_CHANGED_IBSS = 1<<11,
164 BSS_CHANGED_ARP_FILTER = 1<<12, 166 BSS_CHANGED_ARP_FILTER = 1<<12,
167 BSS_CHANGED_QOS = 1<<13,
165 168
166 /* when adding here, make sure to change ieee80211_reconfig */ 169 /* when adding here, make sure to change ieee80211_reconfig */
167}; 170};
@@ -217,6 +220,7 @@ enum ieee80211_bss_change {
217 * filter ARP queries based on the @arp_addr_list, if disabled, the 220 * filter ARP queries based on the @arp_addr_list, if disabled, the
218 * hardware must not perform any ARP filtering. Note, that the filter will 221 * hardware must not perform any ARP filtering. Note, that the filter will
219 * be enabled also in promiscuous mode. 222 * be enabled also in promiscuous mode.
223 * @qos: This is a QoS-enabled BSS.
220 */ 224 */
221struct ieee80211_bss_conf { 225struct ieee80211_bss_conf {
222 const u8 *bssid; 226 const u8 *bssid;
@@ -240,6 +244,7 @@ struct ieee80211_bss_conf {
240 __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; 244 __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN];
241 u8 arp_addr_cnt; 245 u8 arp_addr_cnt;
242 bool arp_filter_enabled; 246 bool arp_filter_enabled;
247 bool qos;
243}; 248};
244 249
245/** 250/**
@@ -620,15 +625,11 @@ struct ieee80211_rx_status {
620 * may turn the device off as much as possible. Typically, this flag will 625 * may turn the device off as much as possible. Typically, this flag will
621 * be set when an interface is set UP but not associated or scanning, but 626 * be set when an interface is set UP but not associated or scanning, but
622 * it can also be unset in that case when monitor interfaces are active. 627 * it can also be unset in that case when monitor interfaces are active.
623 * @IEEE80211_CONF_QOS: Enable 802.11e QoS also know as WMM (Wireless
624 * Multimedia). On some drivers (iwlwifi is one of know) we have
625 * to enable/disable QoS explicitly.
626 */ 628 */
627enum ieee80211_conf_flags { 629enum ieee80211_conf_flags {
628 IEEE80211_CONF_MONITOR = (1<<0), 630 IEEE80211_CONF_MONITOR = (1<<0),
629 IEEE80211_CONF_PS = (1<<1), 631 IEEE80211_CONF_PS = (1<<1),
630 IEEE80211_CONF_IDLE = (1<<2), 632 IEEE80211_CONF_IDLE = (1<<2),
631 IEEE80211_CONF_QOS = (1<<3),
632}; 633};
633 634
634 635
@@ -643,7 +644,6 @@ enum ieee80211_conf_flags {
643 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed 644 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed
644 * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed 645 * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed
645 * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed 646 * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed
646 * @IEEE80211_CONF_CHANGE_QOS: Quality of service was enabled or disabled
647 */ 647 */
648enum ieee80211_conf_changed { 648enum ieee80211_conf_changed {
649 IEEE80211_CONF_CHANGE_SMPS = BIT(1), 649 IEEE80211_CONF_CHANGE_SMPS = BIT(1),
@@ -654,7 +654,6 @@ enum ieee80211_conf_changed {
654 IEEE80211_CONF_CHANGE_CHANNEL = BIT(6), 654 IEEE80211_CONF_CHANGE_CHANNEL = BIT(6),
655 IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(7), 655 IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(7),
656 IEEE80211_CONF_CHANGE_IDLE = BIT(8), 656 IEEE80211_CONF_CHANGE_IDLE = BIT(8),
657 IEEE80211_CONF_CHANGE_QOS = BIT(9),
658}; 657};
659 658
660/** 659/**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 5b8b4460b69f..35b07ea0633a 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1154,10 +1154,6 @@ static int ieee80211_set_txq_params(struct wiphy *wiphy,
1154 return -EINVAL; 1154 return -EINVAL;
1155 } 1155 }
1156 1156
1157 /* enable WMM or activate new settings */
1158 local->hw.conf.flags |= IEEE80211_CONF_QOS;
1159 drv_config(local, IEEE80211_CONF_CHANGE_QOS);
1160
1161 return 0; 1157 return 0;
1162} 1158}
1163 1159
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index d1962650b254..7a4e4bffbc71 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -698,10 +698,11 @@ void ieee80211_dynamic_ps_timer(unsigned long data)
698 698
699/* MLME */ 699/* MLME */
700static void ieee80211_sta_wmm_params(struct ieee80211_local *local, 700static void ieee80211_sta_wmm_params(struct ieee80211_local *local,
701 struct ieee80211_if_managed *ifmgd, 701 struct ieee80211_sub_if_data *sdata,
702 u8 *wmm_param, size_t wmm_param_len) 702 u8 *wmm_param, size_t wmm_param_len)
703{ 703{
704 struct ieee80211_tx_queue_params params; 704 struct ieee80211_tx_queue_params params;
705 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
705 size_t left; 706 size_t left;
706 int count; 707 int count;
707 u8 *pos, uapsd_queues = 0; 708 u8 *pos, uapsd_queues = 0;
@@ -790,8 +791,8 @@ static void ieee80211_sta_wmm_params(struct ieee80211_local *local,
790 } 791 }
791 792
792 /* enable WMM or activate new settings */ 793 /* enable WMM or activate new settings */
793 local->hw.conf.flags |= IEEE80211_CONF_QOS; 794 sdata->vif.bss_conf.qos = true;
794 drv_config(local, IEEE80211_CONF_CHANGE_QOS); 795 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_QOS);
795} 796}
796 797
797static u32 ieee80211_handle_bss_capability(struct ieee80211_sub_if_data *sdata, 798static u32 ieee80211_handle_bss_capability(struct ieee80211_sub_if_data *sdata,
@@ -1325,7 +1326,7 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk,
1325 } 1326 }
1326 1327
1327 if (elems.wmm_param) 1328 if (elems.wmm_param)
1328 ieee80211_sta_wmm_params(local, ifmgd, elems.wmm_param, 1329 ieee80211_sta_wmm_params(local, sdata, elems.wmm_param,
1329 elems.wmm_param_len); 1330 elems.wmm_param_len);
1330 else 1331 else
1331 ieee80211_set_wmm_default(sdata); 1332 ieee80211_set_wmm_default(sdata);
@@ -1597,7 +1598,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
1597 ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems, 1598 ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems,
1598 true); 1599 true);
1599 1600
1600 ieee80211_sta_wmm_params(local, ifmgd, elems.wmm_param, 1601 ieee80211_sta_wmm_params(local, sdata, elems.wmm_param,
1601 elems.wmm_param_len); 1602 elems.wmm_param_len);
1602 } 1603 }
1603 1604
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index a54cf146ed50..794792177376 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -803,8 +803,8 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata)
803 803
804 /* after reinitialize QoS TX queues setting to default, 804 /* after reinitialize QoS TX queues setting to default,
805 * disable QoS at all */ 805 * disable QoS at all */
806 local->hw.conf.flags &= ~IEEE80211_CONF_QOS; 806 sdata->vif.bss_conf.qos = sdata->vif.type != NL80211_IFTYPE_STATION;
807 drv_config(local, IEEE80211_CONF_CHANGE_QOS); 807 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_QOS);
808} 808}
809 809
810void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata, 810void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
@@ -1161,7 +1161,8 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1161 BSS_CHANGED_BASIC_RATES | 1161 BSS_CHANGED_BASIC_RATES |
1162 BSS_CHANGED_BEACON_INT | 1162 BSS_CHANGED_BEACON_INT |
1163 BSS_CHANGED_BSSID | 1163 BSS_CHANGED_BSSID |
1164 BSS_CHANGED_CQM; 1164 BSS_CHANGED_CQM |
1165 BSS_CHANGED_QOS;
1165 1166
1166 switch (sdata->vif.type) { 1167 switch (sdata->vif.type) {
1167 case NL80211_IFTYPE_STATION: 1168 case NL80211_IFTYPE_STATION: