Commit bcf5a476 authored by Brian Norris's avatar Brian Norris Committed by Khalid Elmously

mac80211: don't warn about CW params when not using them

BugLink: https://bugs.launchpad.net/bugs/1845038

[ Upstream commit d2b3fe42 ]

ieee80211_set_wmm_default() normally sets up the initial CW min/max for
each queue, except that it skips doing this if the driver doesn't
support ->conf_tx. We still end up calling drv_conf_tx() in some cases
(e.g., ieee80211_reconfig()), which also still won't do anything
useful...except it complains here about the invalid CW parameters.

Let's just skip the WARN if we weren't going to do anything useful with
the parameters.
Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
Link: https://lore.kernel.org/r/20190718015712.197499-1-briannorris@chromium.orgSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 6e604780
...@@ -169,11 +169,16 @@ int drv_conf_tx(struct ieee80211_local *local, ...@@ -169,11 +169,16 @@ int drv_conf_tx(struct ieee80211_local *local,
if (!check_sdata_in_driver(sdata)) if (!check_sdata_in_driver(sdata))
return -EIO; return -EIO;
if (WARN_ONCE(params->cw_min == 0 || if (params->cw_min == 0 || params->cw_min > params->cw_max) {
params->cw_min > params->cw_max, /*
* If we can't configure hardware anyway, don't warn. We may
* never have initialized the CW parameters.
*/
WARN_ONCE(local->ops->conf_tx,
"%s: invalid CW_min/CW_max: %d/%d\n", "%s: invalid CW_min/CW_max: %d/%d\n",
sdata->name, params->cw_min, params->cw_max)) sdata->name, params->cw_min, params->cw_max);
return -EINVAL; return -EINVAL;
}
trace_drv_conf_tx(local, sdata, ac, params); trace_drv_conf_tx(local, sdata, ac, params);
if (local->ops->conf_tx) if (local->ops->conf_tx)
......
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