aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-09-05 00:33:03 -0400
committerDavid S. Miller <davem@davemloft.net>2018-09-05 00:33:03 -0400
commit36302685f59345959de96d0d70a5ad20a3a3451b (patch)
tree778b3170acd1131840823520a4664f2bba343dbe /net/mac80211/util.c
parent2fc4aa59ab470f1d5124b33c05680e2b2f2c6f65 (diff)
parent28619527b8a712590c93d0a9e24b4425b9376a8c (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
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 d886789ff59e..b51fdcb5adf9 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1235,7 +1235,7 @@ void ieee80211_regulatory_limit_wmm_params(struct ieee80211_sub_if_data *sdata,
1235{ 1235{
1236 struct ieee80211_chanctx_conf *chanctx_conf; 1236 struct ieee80211_chanctx_conf *chanctx_conf;
1237 const struct ieee80211_reg_rule *rrule; 1237 const struct ieee80211_reg_rule *rrule;
1238 struct ieee80211_wmm_ac *wmm_ac; 1238 const struct ieee80211_wmm_ac *wmm_ac;
1239 u16 center_freq = 0; 1239 u16 center_freq = 0;
1240 1240
1241 if (sdata->vif.type != NL80211_IFTYPE_AP && 1241 if (sdata->vif.type != NL80211_IFTYPE_AP &&
@@ -1254,20 +1254,19 @@ void ieee80211_regulatory_limit_wmm_params(struct ieee80211_sub_if_data *sdata,
1254 1254
1255 rrule = freq_reg_info(sdata->wdev.wiphy, MHZ_TO_KHZ(center_freq)); 1255 rrule = freq_reg_info(sdata->wdev.wiphy, MHZ_TO_KHZ(center_freq));
1256 1256
1257 if (IS_ERR_OR_NULL(rrule) || !rrule->wmm_rule) { 1257 if (IS_ERR_OR_NULL(rrule) || !rrule->has_wmm) {
1258 rcu_read_unlock(); 1258 rcu_read_unlock();
1259 return; 1259 return;
1260 } 1260 }
1261 1261
1262 if (sdata->vif.type == NL80211_IFTYPE_AP) 1262 if (sdata->vif.type == NL80211_IFTYPE_AP)
1263 wmm_ac = &rrule->wmm_rule->ap[ac]; 1263 wmm_ac = &rrule->wmm_rule.ap[ac];
1264 else 1264 else
1265 wmm_ac = &rrule->wmm_rule->client[ac]; 1265 wmm_ac = &rrule->wmm_rule.client[ac];
1266 qparam->cw_min = max_t(u16, qparam->cw_min, wmm_ac->cw_min); 1266 qparam->cw_min = max_t(u16, qparam->cw_min, wmm_ac->cw_min);
1267 qparam->cw_max = max_t(u16, qparam->cw_max, wmm_ac->cw_max); 1267 qparam->cw_max = max_t(u16, qparam->cw_max, wmm_ac->cw_max);
1268 qparam->aifs = max_t(u8, qparam->aifs, wmm_ac->aifsn); 1268 qparam->aifs = max_t(u8, qparam->aifs, wmm_ac->aifsn);
1269 qparam->txop = !qparam->txop ? wmm_ac->cot / 32 : 1269 qparam->txop = min_t(u16, qparam->txop, wmm_ac->cot / 32);
1270 min_t(u16, qparam->txop, wmm_ac->cot / 32);
1271 rcu_read_unlock(); 1270 rcu_read_unlock();
1272} 1271}
1273 1272