Skip to content

Commit 1f4ffde

Browse files
realtwojmberg-intel
authored andcommitted
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: Fred Zhou <fred.zy@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 0cfcefe commit 1f4ffde

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

‎net/mac80211/util.c‎

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,14 +1004,21 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
10041004
*/
10051005
enable_qos = (sdata->vif.type != NL80211_IFTYPE_STATION);
10061006

1007-
for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
1008-
/* Set defaults according to 802.11-2007 Table 7-37 */
1009-
aCWmax = 1023;
1010-
if (use_11b)
1011-
aCWmin = 31;
1012-
else
1013-
aCWmin = 15;
1007+
/* Set defaults according to 802.11-2007 Table 7-37 */
1008+
aCWmax = 1023;
1009+
if (use_11b)
1010+
aCWmin = 31;
1011+
else
1012+
aCWmin = 15;
10141013

1014+
/* Confiure old 802.11b/g medium access rules. */
1015+
qparam.cw_max = aCWmax;
1016+
qparam.cw_min = aCWmin;
1017+
qparam.txop = 0;
1018+
qparam.aifs = 2;
1019+
1020+
for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
1021+
/* Update if QoS is enabled. */
10151022
if (enable_qos) {
10161023
switch (ac) {
10171024
case IEEE80211_AC_BK:
@@ -1047,12 +1054,6 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
10471054
qparam.aifs = 2;
10481055
break;
10491056
}
1050-
} else {
1051-
/* Confiure old 802.11b/g medium access rules. */
1052-
qparam.cw_max = aCWmax;
1053-
qparam.cw_min = aCWmin;
1054-
qparam.txop = 0;
1055-
qparam.aifs = 2;
10561057
}
10571058

10581059
qparam.uapsd = false;

0 commit comments

Comments
 (0)