[lvc-project] [PATCH 1/1] wifi: mac80211: ignore the bitrate mask when scanning
Johannes Berg
johannes at sipsolutions.net
Fri Jan 26 13:06:50 MSK 2024
On Thu, 2024-01-25 at 12:07 +0300, Dmitry Antipov wrote:
>
> +++ b/net/mac80211/rate.c
> @@ -351,6 +351,7 @@ static void __rate_control_send_low(struct ieee80211_hw *hw,
> int i;
> u32 rate_flags =
> ieee80211_chandef_rate_flags(&hw->conf.chandef);
> + bool scanning = !!(info->control.flags & IEEE80211_TX_CTRL_SCAN_TX);
>
> if (sband->band == NL80211_BAND_S1GHZ) {
> info->control.rates[0].flags |= IEEE80211_TX_RC_S1G_MCS;
> @@ -364,7 +365,8 @@ static void __rate_control_send_low(struct ieee80211_hw *hw,
>
> info->control.rates[0].idx = 0;
> for (i = 0; i < sband->n_bitrates; i++) {
> - if (!(rate_mask & BIT(i)))
> + /* Do not use the bitrate mask when scanning. */
> + if (!scanning && !(rate_mask & BIT(i)))
> continue;
>
I know my patch didn't work, but I think I'd still prefer if we didn't
pass a 0 rate mask around to ignore it - maybe we can just make it ~0 in
the outer place that looks at the sdata mask(s)?
I'm not sure why we fill "BIT(sband->n_bitrates) - 1" rather than ~0 in
the first place, we always (have to) check anyway, so wouldn't really
care about having more bits set than rates exist ...
johannes
More information about the lvc-project
mailing list