Commit 764bf166 authored by Razvan Grigore's avatar Razvan Grigore Committed by Felix Fietkau
Browse files

wifi: mt76: add mt76_get_power_bound helper function



This will replace mt7915_get_power_bound function from b/mt7915/mcu.h,
since we will need it also for mt7921 and mt7925

Signed-off-by: default avatarRazvan Grigore <razvan.grigore@vampirebyte.ro>
Link: https://patch.msgid.link/20250211081247.5892-2-razvan.grigore@vampirebyte.ro


Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 51ac8dbb
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1697,6 +1697,17 @@ void mt76_wcid_add_poll(struct mt76_dev *dev, struct mt76_wcid *wcid)
}
EXPORT_SYMBOL_GPL(mt76_wcid_add_poll);

s8 mt76_get_power_bound(struct mt76_phy *phy, s8 txpower)
{
	int n_chains = hweight16(phy->chainmask);

	txpower = mt76_get_sar_power(phy, phy->chandef.chan, txpower * 2);
	txpower -= mt76_tx_power_nss_delta(n_chains);

	return txpower;
}
EXPORT_SYMBOL_GPL(mt76_get_power_bound);

int mt76_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
		     unsigned int link_id, int *dbm)
{
+2 −0
Original line number Diff line number Diff line
@@ -1483,6 +1483,8 @@ void mt76_sta_pre_rcu_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,

int mt76_get_min_avg_rssi(struct mt76_dev *dev, u8 phy_idx);

s8 mt76_get_power_bound(struct mt76_phy *phy, s8 txpower);

int mt76_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
		     unsigned int link_id, int *dbm);
int mt76_init_sar_power(struct ieee80211_hw *hw,