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>
This commit is contained in:
committed by
John W. Linville
parent
ca21614d4c
commit
3434fbd398
@@ -157,9 +157,10 @@ void ieee80211_if_set_type(struct net_device *dev, int type)
|
|||||||
ifsta->auth_algs = IEEE80211_AUTH_ALG_OPEN |
|
ifsta->auth_algs = IEEE80211_AUTH_ALG_OPEN |
|
||||||
IEEE80211_AUTH_ALG_SHARED_KEY;
|
IEEE80211_AUTH_ALG_SHARED_KEY;
|
||||||
ifsta->flags |= IEEE80211_STA_CREATE_IBSS |
|
ifsta->flags |= IEEE80211_STA_CREATE_IBSS |
|
||||||
IEEE80211_STA_WMM_ENABLED |
|
|
||||||
IEEE80211_STA_AUTO_BSSID_SEL |
|
IEEE80211_STA_AUTO_BSSID_SEL |
|
||||||
IEEE80211_STA_AUTO_CHANNEL_SEL;
|
IEEE80211_STA_AUTO_CHANNEL_SEL;
|
||||||
|
if (sdata->local->hw.queues >= 4)
|
||||||
|
ifsta->flags |= IEEE80211_STA_WMM_ENABLED;
|
||||||
|
|
||||||
msdata = IEEE80211_DEV_TO_SUB_IF(sdata->local->mdev);
|
msdata = IEEE80211_DEV_TO_SUB_IF(sdata->local->mdev);
|
||||||
sdata->bss = &msdata->u.ap;
|
sdata->bss = &msdata->u.ap;
|
||||||
|
@@ -272,6 +272,12 @@ static void ieee80211_sta_wmm_params(struct net_device *dev,
|
|||||||
int count;
|
int count;
|
||||||
u8 *pos;
|
u8 *pos;
|
||||||
|
|
||||||
|
if (!(ifsta->flags & IEEE80211_STA_WMM_ENABLED))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!wmm_param)
|
||||||
|
return;
|
||||||
|
|
||||||
if (wmm_param_len < 8 || wmm_param[5] /* version */ != 1)
|
if (wmm_param_len < 8 || wmm_param[5] /* version */ != 1)
|
||||||
return;
|
return;
|
||||||
count = wmm_param[6] & 0x0f;
|
count = wmm_param[6] & 0x0f;
|
||||||
@@ -763,8 +769,10 @@ static void ieee80211_send_assoc(struct net_device *dev,
|
|||||||
*pos++ = 1; /* WME ver */
|
*pos++ = 1; /* WME ver */
|
||||||
*pos++ = 0;
|
*pos++ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* wmm support is a must to HT */
|
/* wmm support is a must to HT */
|
||||||
if (wmm && sband->ht_info.ht_supported) {
|
if (wmm && (ifsta->flags & IEEE80211_STA_WMM_ENABLED) &&
|
||||||
|
sband->ht_info.ht_supported) {
|
||||||
__le16 tmp = cpu_to_le16(sband->ht_info.cap);
|
__le16 tmp = cpu_to_le16(sband->ht_info.cap);
|
||||||
pos = skb_put(skb, sizeof(struct ieee80211_ht_cap)+2);
|
pos = skb_put(skb, sizeof(struct ieee80211_ht_cap)+2);
|
||||||
*pos++ = WLAN_EID_HT_CAPABILITY;
|
*pos++ = WLAN_EID_HT_CAPABILITY;
|
||||||
@@ -2021,7 +2029,8 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
|
|||||||
else
|
else
|
||||||
sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE;
|
sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE;
|
||||||
|
|
||||||
if (elems.ht_cap_elem && elems.ht_info_elem && elems.wmm_param) {
|
if (elems.ht_cap_elem && elems.ht_info_elem && elems.wmm_param &&
|
||||||
|
(ifsta->flags & IEEE80211_STA_WMM_ENABLED)) {
|
||||||
struct ieee80211_ht_bss_info bss_info;
|
struct ieee80211_ht_bss_info bss_info;
|
||||||
ieee80211_ht_cap_ie_to_ht_info(
|
ieee80211_ht_cap_ie_to_ht_info(
|
||||||
(struct ieee80211_ht_cap *)
|
(struct ieee80211_ht_cap *)
|
||||||
@@ -2034,7 +2043,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
|
|||||||
|
|
||||||
rate_control_rate_init(sta, local);
|
rate_control_rate_init(sta, local);
|
||||||
|
|
||||||
if (elems.wmm_param && (ifsta->flags & IEEE80211_STA_WMM_ENABLED)) {
|
if (elems.wmm_param) {
|
||||||
sta->flags |= WLAN_STA_WME;
|
sta->flags |= WLAN_STA_WME;
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
ieee80211_sta_wmm_params(dev, ifsta, elems.wmm_param,
|
ieee80211_sta_wmm_params(dev, ifsta, elems.wmm_param,
|
||||||
@@ -2817,10 +2826,8 @@ static void ieee80211_rx_mgmt_beacon(struct net_device *dev,
|
|||||||
|
|
||||||
ieee802_11_parse_elems(mgmt->u.beacon.variable, len - baselen, &elems);
|
ieee802_11_parse_elems(mgmt->u.beacon.variable, len - baselen, &elems);
|
||||||
|
|
||||||
if (elems.wmm_param && (ifsta->flags & IEEE80211_STA_WMM_ENABLED)) {
|
ieee80211_sta_wmm_params(dev, ifsta, elems.wmm_param,
|
||||||
ieee80211_sta_wmm_params(dev, ifsta, elems.wmm_param,
|
elems.wmm_param_len);
|
||||||
elems.wmm_param_len);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Do not send changes to driver if we are scanning. This removes
|
/* Do not send changes to driver if we are scanning. This removes
|
||||||
* requirement that driver's bss_info_changed function needs to be
|
* requirement that driver's bss_info_changed function needs to be
|
||||||
|
@@ -1490,8 +1490,8 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
|
|||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* receiver is QoS enabled, use a QoS type frame */
|
/* receiver and we are QoS enabled, use a QoS type frame */
|
||||||
if (sta_flags & WLAN_STA_WME) {
|
if (sta_flags & WLAN_STA_WME && local->hw.queues >= 4) {
|
||||||
fc |= IEEE80211_STYPE_QOS_DATA;
|
fc |= IEEE80211_STYPE_QOS_DATA;
|
||||||
hdrlen += 2;
|
hdrlen += 2;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user