Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac80211: respect rate mask in TX

Bitrate mask were not respected in transmissions, causing (for
example) P2P GO/client to use CCK rates for auth and assoc frames.
Fix it by considering the rate mask in __rate_control_send_low().

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Andrei Otcheretianski and committed by
Johannes Berg
1d2d350b 1431fcb7

+9 -3
+9 -3
net/mac80211/rate.c
··· 235 235 static void __rate_control_send_low(struct ieee80211_hw *hw, 236 236 struct ieee80211_supported_band *sband, 237 237 struct ieee80211_sta *sta, 238 - struct ieee80211_tx_info *info) 238 + struct ieee80211_tx_info *info, 239 + u32 rate_mask) 239 240 { 240 241 int i; 241 242 u32 rate_flags = ··· 248 247 249 248 info->control.rates[0].idx = 0; 250 249 for (i = 0; i < sband->n_bitrates; i++) { 250 + if (!(rate_mask & BIT(i))) 251 + continue; 252 + 251 253 if ((rate_flags & sband->bitrates[i].flags) != rate_flags) 252 254 continue; 253 255 ··· 281 277 bool use_basicrate = false; 282 278 283 279 if (!pubsta || !priv_sta || rc_no_data_or_no_ack_use_min(txrc)) { 284 - __rate_control_send_low(txrc->hw, sband, pubsta, info); 280 + __rate_control_send_low(txrc->hw, sband, pubsta, info, 281 + txrc->rate_idx_mask); 285 282 286 283 if (!pubsta && txrc->bss) { 287 284 mcast_rate = txrc->bss_conf->mcast_rate[sband->band]; ··· 664 659 rate_control_apply_mask(sdata, sta, sband, info, dest, max_rates); 665 660 666 661 if (dest[0].idx < 0) 667 - __rate_control_send_low(&sdata->local->hw, sband, sta, info); 662 + __rate_control_send_low(&sdata->local->hw, sband, sta, info, 663 + sdata->rc_rateidx_mask[info->band]); 668 664 669 665 if (sta) 670 666 rate_fixup_ratelist(vif, sband, info, dest, max_rates);