diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-05-02 18:59:37 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-14 16:29:33 -0400 |
commit | 3434fbd39862d471c92b66c28cd449deea8e9f90 (patch) | |
tree | 8a759cac10a7aa9400dfb2c3ab5153af1f7a10d5 /net/mac80211 | |
parent | ca21614d4c7a176d3723ac211873020b3722dbda (diff) |
mac80211: require four hardware queues for QoS/HT
This patch makes mac80211 only announce QoS/HT support when
the underlying hardware has four (or more) queues.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Ron Rindjunksi <ron.rindjunksi@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/iface.c | 3 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 21 | ||||
-rw-r--r-- | net/mac80211/tx.c | 4 |
3 files changed, 18 insertions, 10 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index f41c7e0de62..5a9a3c6ef48 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -157,9 +157,10 @@ void ieee80211_if_set_type(struct net_device *dev, int type) | |||
157 | ifsta->auth_algs = IEEE80211_AUTH_ALG_OPEN | | 157 | ifsta->auth_algs = IEEE80211_AUTH_ALG_OPEN | |
158 | IEEE80211_AUTH_ALG_SHARED_KEY; | 158 | IEEE80211_AUTH_ALG_SHARED_KEY; |
159 | ifsta->flags |= IEEE80211_STA_CREATE_IBSS | | 159 | ifsta->flags |= IEEE80211_STA_CREATE_IBSS | |
160 | IEEE80211_STA_WMM_ENABLED | | ||
161 | IEEE80211_STA_AUTO_BSSID_SEL | | 160 | IEEE80211_STA_AUTO_BSSID_SEL | |
162 | IEEE80211_STA_AUTO_CHANNEL_SEL; | 161 | IEEE80211_STA_AUTO_CHANNEL_SEL; |
162 | if (sdata->local->hw.queues >= 4) | ||
163 | ifsta->flags |= IEEE80211_STA_WMM_ENABLED; | ||
163 | 164 | ||
164 | msdata = IEEE80211_DEV_TO_SUB_IF(sdata->local->mdev); | 165 | msdata = IEEE80211_DEV_TO_SUB_IF(sdata->local->mdev); |
165 | sdata->bss = &msdata->u.ap; | 166 | sdata->bss = &msdata->u.ap; |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 55b85ae5bc1..108c6fc42fe 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -272,6 +272,12 @@ static void ieee80211_sta_wmm_params(struct net_device *dev, | |||
272 | int count; | 272 | int count; |
273 | u8 *pos; | 273 | u8 *pos; |
274 | 274 | ||
275 | if (!(ifsta->flags & IEEE80211_STA_WMM_ENABLED)) | ||
276 | return; | ||
277 | |||
278 | if (!wmm_param) | ||
279 | return; | ||
280 | |||
275 | if (wmm_param_len < 8 || wmm_param[5] /* version */ != 1) | 281 | if (wmm_param_len < 8 || wmm_param[5] /* version */ != 1) |
276 | return; | 282 | return; |
277 | count = wmm_param[6] & 0x0f; | 283 | count = wmm_param[6] & 0x0f; |
@@ -763,8 +769,10 @@ static void ieee80211_send_assoc(struct net_device *dev, | |||
763 | *pos++ = 1; /* WME ver */ | 769 | *pos++ = 1; /* WME ver */ |
764 | *pos++ = 0; | 770 | *pos++ = 0; |
765 | } | 771 | } |
772 | |||
766 | /* wmm support is a must to HT */ | 773 | /* wmm support is a must to HT */ |
767 | if (wmm && sband->ht_info.ht_supported) { | 774 | if (wmm && (ifsta->flags & IEEE80211_STA_WMM_ENABLED) && |
775 | sband->ht_info.ht_supported) { | ||
768 | __le16 tmp = cpu_to_le16(sband->ht_info.cap); | 776 | __le16 tmp = cpu_to_le16(sband->ht_info.cap); |
769 | pos = skb_put(skb, sizeof(struct ieee80211_ht_cap)+2); | 777 | pos = skb_put(skb, sizeof(struct ieee80211_ht_cap)+2); |
770 | *pos++ = WLAN_EID_HT_CAPABILITY; | 778 | *pos++ = WLAN_EID_HT_CAPABILITY; |
@@ -2021,7 +2029,8 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, | |||
2021 | else | 2029 | else |
2022 | sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE; | 2030 | sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE; |
2023 | 2031 | ||
2024 | if (elems.ht_cap_elem && elems.ht_info_elem && elems.wmm_param) { | 2032 | if (elems.ht_cap_elem && elems.ht_info_elem && elems.wmm_param && |
2033 | (ifsta->flags & IEEE80211_STA_WMM_ENABLED)) { | ||
2025 | struct ieee80211_ht_bss_info bss_info; | 2034 | struct ieee80211_ht_bss_info bss_info; |
2026 | ieee80211_ht_cap_ie_to_ht_info( | 2035 | ieee80211_ht_cap_ie_to_ht_info( |
2027 | (struct ieee80211_ht_cap *) | 2036 | (struct ieee80211_ht_cap *) |
@@ -2034,7 +2043,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, | |||
2034 | 2043 | ||
2035 | rate_control_rate_init(sta, local); | 2044 | rate_control_rate_init(sta, local); |
2036 | 2045 | ||
2037 | if (elems.wmm_param && (ifsta->flags & IEEE80211_STA_WMM_ENABLED)) { | 2046 | if (elems.wmm_param) { |
2038 | sta->flags |= WLAN_STA_WME; | 2047 | sta->flags |= WLAN_STA_WME; |
2039 | rcu_read_unlock(); | 2048 | rcu_read_unlock(); |
2040 | ieee80211_sta_wmm_params(dev, ifsta, elems.wmm_param, | 2049 | ieee80211_sta_wmm_params(dev, ifsta, elems.wmm_param, |
@@ -2817,10 +2826,8 @@ static void ieee80211_rx_mgmt_beacon(struct net_device *dev, | |||
2817 | 2826 | ||
2818 | ieee802_11_parse_elems(mgmt->u.beacon.variable, len - baselen, &elems); | 2827 | ieee802_11_parse_elems(mgmt->u.beacon.variable, len - baselen, &elems); |
2819 | 2828 | ||
2820 | if (elems.wmm_param && (ifsta->flags & IEEE80211_STA_WMM_ENABLED)) { | 2829 | ieee80211_sta_wmm_params(dev, ifsta, elems.wmm_param, |
2821 | ieee80211_sta_wmm_params(dev, ifsta, elems.wmm_param, | 2830 | elems.wmm_param_len); |
2822 | elems.wmm_param_len); | ||
2823 | } | ||
2824 | 2831 | ||
2825 | /* Do not send changes to driver if we are scanning. This removes | 2832 | /* Do not send changes to driver if we are scanning. This removes |
2826 | * requirement that driver's bss_info_changed function needs to be | 2833 | * requirement that driver's bss_info_changed function needs to be |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index f35eaea98e7..3a03d7807c3 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -1490,8 +1490,8 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1490 | rcu_read_unlock(); | 1490 | rcu_read_unlock(); |
1491 | } | 1491 | } |
1492 | 1492 | ||
1493 | /* receiver is QoS enabled, use a QoS type frame */ | 1493 | /* receiver and we are QoS enabled, use a QoS type frame */ |
1494 | if (sta_flags & WLAN_STA_WME) { | 1494 | if (sta_flags & WLAN_STA_WME && local->hw.queues >= 4) { |
1495 | fc |= IEEE80211_STYPE_QOS_DATA; | 1495 | fc |= IEEE80211_STYPE_QOS_DATA; |
1496 | hdrlen += 2; | 1496 | hdrlen += 2; |
1497 | } | 1497 | } |