Skip to content

Commit

Permalink
mt76: generalize mt76_get_txpower for 4x4:4 devices
Browse files Browse the repository at this point in the history
Genralize mt76_get_txpower routine for 4x4:4 capable devices
in order to be reused in mt7615 driver

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
Lorenzo Bianconi authored and Felix Fietkau committed Jun 27, 2019
1 parent c988a77 commit c19b0ca
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions drivers/net/wireless/mediatek/mt76/mac80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,10 +766,21 @@ int mt76_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
*dbm = DIV_ROUND_UP(dev->txpower_cur, 2);

/* convert from per-chain power to combined
* output on 2x2 devices
* output power
*/
if (n_chains > 1)
switch (n_chains) {
case 4:
*dbm += 6;
break;
case 3:
*dbm += 4;
break;
case 2:
*dbm += 3;
break;
default:
break;
}

return 0;
}
Expand Down

0 comments on commit c19b0ca

Please sign in to comment.