summaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 88efda7c9f8a..716cd6442d86 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1135,7 +1135,7 @@ void ieee80211_regulatory_limit_wmm_params(struct ieee80211_sub_if_data *sdata,
1135{ 1135{
1136 struct ieee80211_chanctx_conf *chanctx_conf; 1136 struct ieee80211_chanctx_conf *chanctx_conf;
1137 const struct ieee80211_reg_rule *rrule; 1137 const struct ieee80211_reg_rule *rrule;
1138 struct ieee80211_wmm_ac *wmm_ac; 1138 const struct ieee80211_wmm_ac *wmm_ac;
1139 u16 center_freq = 0; 1139 u16 center_freq = 0;
1140 1140
1141 if (sdata->vif.type != NL80211_IFTYPE_AP && 1141 if (sdata->vif.type != NL80211_IFTYPE_AP &&
@@ -1154,20 +1154,19 @@ void ieee80211_regulatory_limit_wmm_params(struct ieee80211_sub_if_data *sdata,
1154 1154
1155 rrule = freq_reg_info(sdata->wdev.wiphy, MHZ_TO_KHZ(center_freq)); 1155 rrule = freq_reg_info(sdata->wdev.wiphy, MHZ_TO_KHZ(center_freq));
1156 1156
1157 if (IS_ERR_OR_NULL(rrule) || !rrule->wmm_rule) { 1157 if (IS_ERR_OR_NULL(rrule) || !rrule->has_wmm) {
1158 rcu_read_unlock(); 1158 rcu_read_unlock();
1159 return; 1159 return;
1160 } 1160 }
1161 1161
1162 if (sdata->vif.type == NL80211_IFTYPE_AP) 1162 if (sdata->vif.type == NL80211_IFTYPE_AP)
1163 wmm_ac = &rrule->wmm_rule->ap[ac]; 1163 wmm_ac = &rrule->wmm_rule.ap[ac];
1164 else 1164 else
1165 wmm_ac = &rrule->wmm_rule->client[ac]; 1165 wmm_ac = &rrule->wmm_rule.client[ac];
1166 qparam->cw_min = max_t(u16, qparam->cw_min, wmm_ac->cw_min); 1166 qparam->cw_min = max_t(u16, qparam->cw_min, wmm_ac->cw_min);
1167 qparam->cw_max = max_t(u16, qparam->cw_max, wmm_ac->cw_max); 1167 qparam->cw_max = max_t(u16, qparam->cw_max, wmm_ac->cw_max);
1168 qparam->aifs = max_t(u8, qparam->aifs, wmm_ac->aifsn); 1168 qparam->aifs = max_t(u8, qparam->aifs, wmm_ac->aifsn);
1169 qparam->txop = !qparam->txop ? wmm_ac->cot / 32 : 1169 qparam->txop = min_t(u16, qparam->txop, wmm_ac->cot / 32);
1170 min_t(u16, qparam->txop, wmm_ac->cot / 32);
1171 rcu_read_unlock(); 1170 rcu_read_unlock();
1172} 1171}
1173 1172