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

mac80211: check for MCS in ieee80211_duration before fetching chanctx

Makes the code a bit more efficient

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Felix Fietkau and committed by
Johannes Berg
95cd470c 70550df2

+4 -4
+4 -4
net/mac80211/tx.c
··· 64 64 struct ieee80211_chanctx_conf *chanctx_conf; 65 65 u32 rate_flags = 0; 66 66 67 + /* assume HW handles this */ 68 + if (tx->rate.flags & (IEEE80211_TX_RC_MCS | IEEE80211_TX_RC_VHT_MCS)) 69 + return 0; 70 + 67 71 rcu_read_lock(); 68 72 chanctx_conf = rcu_dereference(tx->sdata->vif.chanctx_conf); 69 73 if (chanctx_conf) { ··· 75 71 rate_flags = ieee80211_chandef_rate_flags(&chanctx_conf->def); 76 72 } 77 73 rcu_read_unlock(); 78 - 79 - /* assume HW handles this */ 80 - if (tx->rate.flags & (IEEE80211_TX_RC_MCS | IEEE80211_TX_RC_VHT_MCS)) 81 - return 0; 82 74 83 75 /* uh huh? */ 84 76 if (WARN_ON_ONCE(tx->rate.idx < 0))