diff options
author | Allen Ye <allen.ye@mediatek.com> | 2023-11-02 18:02:57 +0800 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2023-12-07 18:50:21 +0100 |
commit | 1e12f0f81f36b7470bcd7e65904ff8264fd31a5b (patch) | |
tree | 2bc25c6572ce7e7744c9af281a1386c61e7c3ef9 | |
parent | f75e4779d215a7dbe7eb7ab6f1ed075fe66930bc (diff) | |
download | lwn-1e12f0f81f36b7470bcd7e65904ff8264fd31a5b.tar.gz lwn-1e12f0f81f36b7470bcd7e65904ff8264fd31a5b.zip |
wifi: mt76: use chainmask for power delta calculation
The power gain value is related to total TX path, so change the
calculation to use per-phy chainmask.
Signed-off-by: Allen Ye <allen.ye@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/eeprom.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mac80211.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7915/mcu.h | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/eeprom.c b/drivers/net/wireless/mediatek/mt76/eeprom.c index 59586fa134e3..0bc66cc19acd 100644 --- a/drivers/net/wireless/mediatek/mt76/eeprom.c +++ b/drivers/net/wireless/mediatek/mt76/eeprom.c @@ -381,7 +381,7 @@ s8 mt76_get_rate_power_limits(struct mt76_phy *phy, if (!np) return target_power; - txs_delta = mt76_get_txs_delta(np, hweight8(phy->antenna_mask)); + txs_delta = mt76_get_txs_delta(np, hweight16(phy->chainmask)); val = mt76_get_of_array(np, "rates-cck", &len, ARRAY_SIZE(dest->cck)); mt76_apply_array_limit(dest->cck, ARRAY_SIZE(dest->cck), val, diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c index d4004a62af1d..8a3a90d1bfac 100644 --- a/drivers/net/wireless/mediatek/mt76/mac80211.c +++ b/drivers/net/wireless/mediatek/mt76/mac80211.c @@ -1548,7 +1548,7 @@ int mt76_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int *dbm) { struct mt76_phy *phy = hw->priv; - int n_chains = hweight8(phy->antenna_mask); + int n_chains = hweight16(phy->chainmask); int delta = mt76_tx_power_nss_delta(n_chains); *dbm = DIV_ROUND_UP(phy->txpower_cur + delta, 2); diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h index 1592b5d6751a..b41ac4aaced7 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h @@ -519,7 +519,7 @@ static inline s8 mt7915_get_power_bound(struct mt7915_phy *phy, s8 txpower) { struct mt76_phy *mphy = phy->mt76; - int n_chains = hweight8(mphy->antenna_mask); + int n_chains = hweight16(mphy->chainmask); txpower = mt76_get_sar_power(mphy, mphy->chandef.chan, txpower * 2); txpower -= mt76_tx_power_nss_delta(n_chains); |