Commit c09f4d0a authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

mt76: mac: minor optimizations in mt76x02_mac_tx_rate_val

Do not set bw variable to zero for legacy rates since it is already
initialized to zero. Moreover set nss to 1 just for legacy rates
since nss will be properly set for VHT/HT rates
Signed-off-by: default avatarLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent f82ce8d9
...@@ -130,10 +130,8 @@ static __le16 ...@@ -130,10 +130,8 @@ static __le16
mt76x02_mac_tx_rate_val(struct mt76x02_dev *dev, mt76x02_mac_tx_rate_val(struct mt76x02_dev *dev,
const struct ieee80211_tx_rate *rate, u8 *nss_val) const struct ieee80211_tx_rate *rate, u8 *nss_val)
{ {
u8 phy, rate_idx, nss, bw = 0;
u16 rateval; u16 rateval;
u8 phy, rate_idx;
u8 nss = 1;
u8 bw = 0;
if (rate->flags & IEEE80211_TX_RC_VHT_MCS) { if (rate->flags & IEEE80211_TX_RC_VHT_MCS) {
rate_idx = rate->idx; rate_idx = rate->idx;
...@@ -164,7 +162,7 @@ mt76x02_mac_tx_rate_val(struct mt76x02_dev *dev, ...@@ -164,7 +162,7 @@ mt76x02_mac_tx_rate_val(struct mt76x02_dev *dev,
phy = val >> 8; phy = val >> 8;
rate_idx = val & 0xff; rate_idx = val & 0xff;
bw = 0; nss = 1;
} }
rateval = FIELD_PREP(MT_RXWI_RATE_INDEX, rate_idx); rateval = FIELD_PREP(MT_RXWI_RATE_INDEX, rate_idx);
......
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