mt76: move mt76x02_get_txpower to mt76 core
It will be reused by mt7603 later Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
@@ -710,3 +710,21 @@ int mt76_sta_state(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_sta_state);
|
||||
|
||||
int mt76_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
int *dbm)
|
||||
{
|
||||
struct mt76_dev *dev = hw->priv;
|
||||
int n_chains = __sw_hweight8(dev->antenna_mask);
|
||||
|
||||
*dbm = dev->txpower_cur / 2;
|
||||
|
||||
/* convert from per-chain power to combined
|
||||
* output on 2x2 devices
|
||||
*/
|
||||
if (n_chains > 1)
|
||||
*dbm += 3;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_get_txpower);
|
||||
|
Reference in New Issue
Block a user