Commit a8ce8544 authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by John W. Linville

mac80211: configure 11b/g channel access rules for legacy APs

For each EDCA TX queue change default settings (in STA mode) to conform
old 802.11b/g channel access rules. This is needed for drivers that do
not have QoS enable/disable "switch" (like rt2x00) to make them work
properly with legacy APs.
Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d202caff
...@@ -804,7 +804,7 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata, ...@@ -804,7 +804,7 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
struct ieee80211_local *local = sdata->local; struct ieee80211_local *local = sdata->local;
struct ieee80211_tx_queue_params qparam; struct ieee80211_tx_queue_params qparam;
int ac; int ac;
bool use_11b; bool use_11b, enable_qos;
int aCWmin, aCWmax; int aCWmin, aCWmax;
if (!local->ops->conf_tx) if (!local->ops->conf_tx)
...@@ -818,6 +818,13 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata, ...@@ -818,6 +818,13 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
use_11b = (local->hw.conf.channel->band == IEEE80211_BAND_2GHZ) && use_11b = (local->hw.conf.channel->band == IEEE80211_BAND_2GHZ) &&
!(sdata->flags & IEEE80211_SDATA_OPERATING_GMODE); !(sdata->flags & IEEE80211_SDATA_OPERATING_GMODE);
/*
* By default disable QoS in STA mode for old access points, which do
* not support 802.11e. New APs will provide proper queue parameters,
* that we will configure later.
*/
enable_qos = (sdata->vif.type != NL80211_IFTYPE_STATION);
for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
/* Set defaults according to 802.11-2007 Table 7-37 */ /* Set defaults according to 802.11-2007 Table 7-37 */
aCWmax = 1023; aCWmax = 1023;
...@@ -826,6 +833,7 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata, ...@@ -826,6 +833,7 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
else else
aCWmin = 15; aCWmin = 15;
if (enable_qos) {
switch (ac) { switch (ac) {
case IEEE80211_AC_BK: case IEEE80211_AC_BK:
qparam.cw_max = aCWmax; qparam.cw_max = aCWmax;
...@@ -833,7 +841,8 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata, ...@@ -833,7 +841,8 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
qparam.txop = 0; qparam.txop = 0;
qparam.aifs = 7; qparam.aifs = 7;
break; break;
default: /* never happens but let's not leave undefined */ /* never happens but let's not leave undefined */
default:
case IEEE80211_AC_BE: case IEEE80211_AC_BE:
qparam.cw_max = aCWmax; qparam.cw_max = aCWmax;
qparam.cw_min = aCWmin; qparam.cw_min = aCWmin;
...@@ -859,6 +868,13 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata, ...@@ -859,6 +868,13 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
qparam.aifs = 2; qparam.aifs = 2;
break; break;
} }
} else {
/* Confiure old 802.11b/g medium access rules. */
qparam.cw_max = aCWmax;
qparam.cw_min = aCWmin;
qparam.txop = 0;
qparam.aifs = 2;
}
qparam.uapsd = false; qparam.uapsd = false;
...@@ -866,12 +882,8 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata, ...@@ -866,12 +882,8 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
drv_conf_tx(local, sdata, ac, &qparam); drv_conf_tx(local, sdata, ac, &qparam);
} }
/* after reinitialize QoS TX queues setting to default,
* disable QoS at all */
if (sdata->vif.type != NL80211_IFTYPE_MONITOR) { if (sdata->vif.type != NL80211_IFTYPE_MONITOR) {
sdata->vif.bss_conf.qos = sdata->vif.bss_conf.qos = enable_qos;
sdata->vif.type != NL80211_IFTYPE_STATION;
if (bss_notify) if (bss_notify)
ieee80211_bss_info_change_notify(sdata, ieee80211_bss_info_change_notify(sdata,
BSS_CHANGED_QOS); BSS_CHANGED_QOS);
......
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