Skip to content

Commit

Permalink
mac80211: don't warn about CW params when not using them
Browse files Browse the repository at this point in the history
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: Brian Norris <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
computersforpeace authored and jmberg-intel committed Jul 20, 2019
1 parent bcc27fa commit d2b3fe4
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions net/mac80211/driver-ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,16 @@ int drv_conf_tx(struct ieee80211_local *local,
if (!check_sdata_in_driver(sdata))
return -EIO;

if (WARN_ONCE(params->cw_min == 0 ||
params->cw_min > params->cw_max,
"%s: invalid CW_min/CW_max: %d/%d\n",
sdata->name, params->cw_min, params->cw_max))
if (params->cw_min == 0 || 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",
sdata->name, params->cw_min, params->cw_max);
return -EINVAL;
}

trace_drv_conf_tx(local, sdata, ac, params);
if (local->ops->conf_tx)
Expand Down

0 comments on commit d2b3fe4

Please sign in to comment.