mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: move mt76_rate_power from core to mt76x02 driver code
Its layout and code is mt76x02 specific Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
+6
-6
@@ -62,23 +62,23 @@ s8 mt76x02_tx_get_max_txpwr_adj(struct mt76x02_dev *dev,
|
||||
u8 mcs = ieee80211_rate_get_vht_mcs(rate);
|
||||
|
||||
if (mcs == 8 || mcs == 9) {
|
||||
max_txpwr = dev->mt76.rate_power.vht[8];
|
||||
max_txpwr = dev->rate_power.vht[8];
|
||||
} else {
|
||||
u8 nss, idx;
|
||||
|
||||
nss = ieee80211_rate_get_vht_nss(rate);
|
||||
idx = ((nss - 1) << 3) + mcs;
|
||||
max_txpwr = dev->mt76.rate_power.ht[idx & 0xf];
|
||||
max_txpwr = dev->rate_power.ht[idx & 0xf];
|
||||
}
|
||||
} else if (rate->flags & IEEE80211_TX_RC_MCS) {
|
||||
max_txpwr = dev->mt76.rate_power.ht[rate->idx & 0xf];
|
||||
max_txpwr = dev->rate_power.ht[rate->idx & 0xf];
|
||||
} else {
|
||||
enum nl80211_band band = dev->mphy.chandef.chan->band;
|
||||
|
||||
if (band == NL80211_BAND_2GHZ) {
|
||||
const struct ieee80211_rate *r;
|
||||
struct wiphy *wiphy = dev->mt76.hw->wiphy;
|
||||
struct mt76_rate_power *rp = &dev->mt76.rate_power;
|
||||
struct mt76x02_rate_power *rp = &dev->rate_power;
|
||||
|
||||
r = &wiphy->bands[band]->bitrates[rate->idx];
|
||||
if (r->flags & IEEE80211_RATE_SHORT_PREAMBLE)
|
||||
@@ -86,7 +86,7 @@ s8 mt76x02_tx_get_max_txpwr_adj(struct mt76x02_dev *dev,
|
||||
else
|
||||
max_txpwr = rp->ofdm[r->hw_value & 0x7];
|
||||
} else {
|
||||
max_txpwr = dev->mt76.rate_power.ofdm[rate->idx & 0x7];
|
||||
max_txpwr = dev->rate_power.ofdm[rate->idx & 0x7];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ void mt76x02_tx_set_txpwr_auto(struct mt76x02_dev *dev, s8 txpwr)
|
||||
s8 txpwr_adj;
|
||||
|
||||
txpwr_adj = mt76x02_tx_get_txpwr_adj(dev, txpwr,
|
||||
dev->mt76.rate_power.ofdm[4]);
|
||||
dev->rate_power.ofdm[4]);
|
||||
mt76_rmw_field(dev, MT_PROT_AUTO_TX_CFG,
|
||||
MT_PROT_AUTO_TX_CFG_PROT_PADJ, txpwr_adj);
|
||||
mt76_rmw_field(dev, MT_PROT_AUTO_TX_CFG,
|
||||
|
||||
Reference in New Issue
Block a user