Commit 1f4ffde8 authored by Fred Zhou's avatar Fred Zhou Committed by Johannes Berg

mac80211: improve default WMM parameter setting

Move the default setting for WMM parameters outside the for loop
to avoid redundant assignment multiple times.
Signed-off-by: default avatarFred Zhou <fred.zy@gmail.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 0cfcefef
...@@ -1004,14 +1004,21 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata, ...@@ -1004,14 +1004,21 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
*/ */
enable_qos = (sdata->vif.type != NL80211_IFTYPE_STATION); enable_qos = (sdata->vif.type != NL80211_IFTYPE_STATION);
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; if (use_11b)
if (use_11b) aCWmin = 31;
aCWmin = 31; else
else aCWmin = 15;
aCWmin = 15;
/* Confiure old 802.11b/g medium access rules. */
qparam.cw_max = aCWmax;
qparam.cw_min = aCWmin;
qparam.txop = 0;
qparam.aifs = 2;
for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
/* Update if QoS is enabled. */
if (enable_qos) { if (enable_qos) {
switch (ac) { switch (ac) {
case IEEE80211_AC_BK: case IEEE80211_AC_BK:
...@@ -1047,12 +1054,6 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata, ...@@ -1047,12 +1054,6 @@ 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;
......
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