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>
This commit is contained in:
parent
f75e4779d2
commit
1e12f0f81f
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user