summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt76.h
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2020-02-11 21:00:56 +0100
committerFelix Fietkau <nbd@nbd.name>2020-02-14 10:06:09 +0100
commit07cda406308b7d11cb77c406044b52752049e78d (patch)
treecb9b66f7cbf44233af2dc4544f961bd5e04100a2 /drivers/net/wireless/mediatek/mt76/mt76.h
parent049019c2a07d7b6c86fff9885cb96ab3095f6583 (diff)
mt76: fix rounding issues on converting per-chain and combined txpower
Unify code converting between the different txpower values. Always add/remove the combined txpower delta before dividing half-dB values. Also fix the combined txpower delta values. The correct half-dB delta for 3 chains is 9, not 8. Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76.h')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
index ca9d8ae43fec..844e58f18a2a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76.h
@@ -755,6 +755,13 @@ static inline bool mt76_is_skb_pktid(u8 pktid)
return pktid >= MT_PACKET_ID_FIRST;
}
+static inline u8 mt76_tx_power_nss_delta(u8 nss)
+{
+ static const u8 nss_delta[4] = { 0, 6, 9, 12 };
+
+ return nss_delta[nss - 1];
+}
+
void mt76_rx(struct mt76_dev *dev, enum mt76_rxq_id q, struct sk_buff *skb);
void mt76_tx(struct mt76_phy *dev, struct ieee80211_sta *sta,
struct mt76_wcid *wcid, struct sk_buff *skb);