]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mt76: mt7996: cleanup mt7996_get_power_bound
authorRazvan Grigore <razvan.grigore@vampirebyte.ro>
Tue, 11 Feb 2025 08:12:47 +0000 (08:12 +0000)
committerFelix Fietkau <nbd@nbd.name>
Wed, 19 Mar 2025 13:47:04 +0000 (14:47 +0100)
Refactor for making use of mt76_get_power_bound instead of the specific
mt7996_get_power_bound, since we need this for other chipsets as well
when calculating txpower

Signed-off-by: Razvan Grigore <razvan.grigore@vampirebyte.ro>
Link: https://patch.msgid.link/20250211081247.5892-6-razvan.grigore@vampirebyte.ro
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
drivers/net/wireless/mediatek/mt76/mt7996/mcu.h

index e4569d032221427bf845192acb07b87816b91fd7..76f489e2f602166247d4be79e12c4400d96d49e3 100644 (file)
@@ -4579,7 +4579,7 @@ int mt7996_mcu_set_txpower_sku(struct mt7996_phy *phy)
        struct sk_buff *skb;
        int i, tx_power;
 
-       tx_power = mt7996_get_power_bound(phy, phy->txpower);
+       tx_power = mt76_get_power_bound(mphy, phy->txpower);
        tx_power = mt76_get_rate_power_limits(mphy, mphy->chandef.chan,
                                              &la, tx_power);
        mphy->txpower_cur = tx_power;
index 43468bcaffc6dd8e972acbf1e1fdc6a1927ba053..bd1ba00e1bc64a1dc0bd58318c2a076cf85e3505 100644 (file)
@@ -809,18 +809,6 @@ enum {
 #define MT7996_MAX_BSS_OFFLOAD_SIZE    (MT7996_MAX_BEACON_SIZE +               \
                                         MT7996_BEACON_UPDATE_SIZE)
 
-static inline s8
-mt7996_get_power_bound(struct mt7996_phy *phy, s8 txpower)
-{
-       struct mt76_phy *mphy = phy->mt76;
-       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);
-
-       return txpower;
-}
-
 enum {
        UNI_BAND_CONFIG_RADIO_ENABLE,
        UNI_BAND_CONFIG_RTS_THRESHOLD = 0x08,