Commit 76f0303d authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

mac80211: simplify wmm check during association

Instead of setting assoc_data->wmm_used solely
based on the BSS also take into account our own
capabilities and later check those.

Also rename "wmm_used" and "uapsd_used" to just
"wmm" and "uapsd".
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 4e74bfdb
...@@ -407,7 +407,7 @@ struct ieee80211_mgd_assoc_data { ...@@ -407,7 +407,7 @@ struct ieee80211_mgd_assoc_data {
u8 ssid[IEEE80211_MAX_SSID_LEN]; u8 ssid[IEEE80211_MAX_SSID_LEN];
u8 ssid_len; u8 ssid_len;
u8 supp_rates_len; u8 supp_rates_len;
bool wmm_used, uapsd_used; bool wmm, uapsd;
bool have_beacon; bool have_beacon;
bool sent_assoc; bool sent_assoc;
bool synced; bool synced;
......
...@@ -570,8 +570,8 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata) ...@@ -570,8 +570,8 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
offset = noffset; offset = noffset;
} }
if (assoc_data->wmm_used && local->hw.queues >= 4) { if (assoc_data->wmm) {
if (assoc_data->uapsd_used) { if (assoc_data->uapsd) {
qos_info = local->uapsd_queues; qos_info = local->uapsd_queues;
qos_info |= (local->uapsd_max_sp_len << qos_info |= (local->uapsd_max_sp_len <<
IEEE80211_WMM_IE_STA_QOSINFO_SP_SHIFT); IEEE80211_WMM_IE_STA_QOSINFO_SP_SHIFT);
...@@ -3305,7 +3305,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, ...@@ -3305,7 +3305,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
ifmgd->ap_smps = ifmgd->req_smps; ifmgd->ap_smps = ifmgd->req_smps;
assoc_data->capability = req->bss->capability; assoc_data->capability = req->bss->capability;
assoc_data->wmm_used = bss->wmm_used; assoc_data->wmm = bss->wmm_used && (local->hw.queues >= 4);
assoc_data->supp_rates = bss->supp_rates; assoc_data->supp_rates = bss->supp_rates;
assoc_data->supp_rates_len = bss->supp_rates_len; assoc_data->supp_rates_len = bss->supp_rates_len;
assoc_data->ht_information_ie = assoc_data->ht_information_ie =
...@@ -3313,10 +3313,10 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, ...@@ -3313,10 +3313,10 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
if (bss->wmm_used && bss->uapsd_supported && if (bss->wmm_used && bss->uapsd_supported &&
(sdata->local->hw.flags & IEEE80211_HW_SUPPORTS_UAPSD)) { (sdata->local->hw.flags & IEEE80211_HW_SUPPORTS_UAPSD)) {
assoc_data->uapsd_used = true; assoc_data->uapsd = true;
ifmgd->flags |= IEEE80211_STA_UAPSD_ENABLED; ifmgd->flags |= IEEE80211_STA_UAPSD_ENABLED;
} else { } else {
assoc_data->uapsd_used = false; assoc_data->uapsd = false;
ifmgd->flags &= ~IEEE80211_STA_UAPSD_ENABLED; ifmgd->flags &= ~IEEE80211_STA_UAPSD_ENABLED;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment