]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mt76: move txpower_conf back to driver specific structs
authorFelix Fietkau <nbd@nbd.name>
Wed, 16 Oct 2019 10:36:16 +0000 (12:36 +0200)
committerFelix Fietkau <nbd@nbd.name>
Fri, 14 Feb 2020 09:03:09 +0000 (10:03 +0100)
Nothing in the core uses it

Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt76.h
drivers/net/wireless/mediatek/mt76/mt76x0/main.c
drivers/net/wireless/mediatek/mt76/mt76x0/phy.c
drivers/net/wireless/mediatek/mt76/mt76x02.h
drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c
drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c
drivers/net/wireless/mediatek/mt76/mt76x2/phy.c
drivers/net/wireless/mediatek/mt76/mt76x2/usb_main.c

index 8aab40ebadf95dee4a8ec882e91503f6d1c30039..7a20f7555082d7564e386edaae74a342a36634e4 100644 (file)
@@ -534,7 +534,6 @@ struct mt76_dev {
        struct mt76_hw_cap cap;
 
        struct mt76_rate_power rate_power;
-       int txpower_conf;
        int txpower_cur;
 
        enum nl80211_dfs_regions region;
index 50b3bba19ddb08cc472d1f1cc7f868e618c2bafe..700ae9c12f1db3c3a4c1a07a357232bd3a72d113 100644 (file)
@@ -44,7 +44,7 @@ int mt76x0_config(struct ieee80211_hw *hw, u32 changed)
        }
 
        if (changed & IEEE80211_CONF_CHANGE_POWER) {
-               dev->mt76.txpower_conf = hw->conf.power_level * 2;
+               dev->txpower_conf = hw->conf.power_level * 2;
 
                if (test_bit(MT76_STATE_RUNNING, &dev->mphy.state))
                        mt76x0_phy_set_txpower(dev);
index 9b1ae77b8fd2f201d14130b62aae7d10f0071e14..0a10d1ee7553c974d28ceec67b3beb89ce39b6d4 100644 (file)
@@ -848,7 +848,7 @@ void mt76x0_phy_set_txpower(struct mt76x02_dev *dev)
        mt76x0_get_power_info(dev, dev->mphy.chandef.chan, &info);
 
        mt76x02_add_rate_power_offset(t, info);
-       mt76x02_limit_rate_power(t, dev->mt76.txpower_conf);
+       mt76x02_limit_rate_power(t, dev->txpower_conf);
        dev->mt76.txpower_cur = mt76x02_get_max_rate_power(t);
        mt76x02_add_rate_power_offset(t, -info);
 
index 28572797a7a67a37e31ccc080cc1b1b5f7db57a1..f00a9a6ee670e45c73dacc2e316d85158efce304 100644 (file)
@@ -108,6 +108,7 @@ struct mt76x02_dev {
 
        struct mt76x02_calibration cal;
 
+       int txpower_conf;
        s8 target_power;
        s8 target_power_delta[2];
        bool enable_tpc;
index 8fe21e7e0996c9dc111968a7710128ab5d5faa6a..098792b86b7380e4ff124657d232c56789d6904f 100644 (file)
@@ -386,7 +386,7 @@ void mt76x02_mac_write_txwi(struct mt76x02_dev *dev, struct mt76x02_txwi *txwi,
                max_txpwr_adj = mt76x02_tx_get_max_txpwr_adj(dev, rate);
        }
 
-       txpwr_adj = mt76x02_tx_get_txpwr_adj(dev, dev->mt76.txpower_conf,
+       txpwr_adj = mt76x02_tx_get_txpwr_adj(dev, dev->txpower_conf,
                                             max_txpwr_adj);
        txwi->ctl2 = FIELD_PREP(MT_TX_PWR_ADJ, txpwr_adj);
 
index 10466545405a1d82fa578f46f0b43457e51805b6..039f9687778781208a96e7122c73e0d0f93162a1 100644 (file)
@@ -96,7 +96,7 @@ s8 mt76x02_tx_get_max_txpwr_adj(struct mt76x02_dev *dev,
 
 s8 mt76x02_tx_get_txpwr_adj(struct mt76x02_dev *dev, s8 txpwr, s8 max_txpwr_adj)
 {
-       txpwr = min_t(s8, txpwr, dev->mt76.txpower_conf);
+       txpwr = min_t(s8, txpwr, dev->txpower_conf);
        txpwr -= (dev->target_power + dev->target_power_delta[0]);
        txpwr = min_t(s8, txpwr, max_txpwr_adj);
 
index bc0ffae7adda28db4cedaa17b071590c6d4f4393..3f82b9cec89ec1918ef36230feb54d8bd4f702df 100644 (file)
@@ -86,14 +86,14 @@ mt76x2_config(struct ieee80211_hw *hw, u32 changed)
        }
 
        if (changed & IEEE80211_CONF_CHANGE_POWER) {
-               dev->mt76.txpower_conf = hw->conf.power_level * 2;
+               dev->txpower_conf = hw->conf.power_level * 2;
 
                /* convert to per-chain power for 2x2 devices */
-               dev->mt76.txpower_conf -= 6;
+               dev->txpower_conf -= 6;
 
                if (test_bit(MT76_STATE_RUNNING, &dev->mphy.state)) {
                        mt76x2_phy_set_txpower(dev);
-                       mt76x02_tx_set_txpwr_auto(dev, dev->mt76.txpower_conf);
+                       mt76x02_tx_set_txpwr_auto(dev, dev->txpower_conf);
                }
        }
 
index 6d457c0dd699ef6bd1af2bfe5e5f9bfe9bd57ab5..58f28e4e3952790c778ed8cc9e183abaee984d59 100644 (file)
@@ -152,7 +152,7 @@ void mt76x2_phy_set_txpower(struct mt76x02_dev *dev)
 
        mt76x2_get_rate_power(dev, &t, chan);
        mt76x02_add_rate_power_offset(&t, txp.target_power + delta);
-       mt76x02_limit_rate_power(&t, dev->mt76.txpower_conf);
+       mt76x02_limit_rate_power(&t, dev->txpower_conf);
        dev->mt76.txpower_cur = mt76x02_get_max_rate_power(&t);
 
        base_power = mt76x2_get_min_rate_power(&t);
index e51b9d38221be8437ccdffe2dffcdbba279851a5..746f1a8304a6bde05fe25169dd3886b9913b23ba 100644 (file)
@@ -78,10 +78,10 @@ mt76x2u_config(struct ieee80211_hw *hw, u32 changed)
        }
 
        if (changed & IEEE80211_CONF_CHANGE_POWER) {
-               dev->mt76.txpower_conf = hw->conf.power_level * 2;
+               dev->txpower_conf = hw->conf.power_level * 2;
 
                /* convert to per-chain power for 2x2 devices */
-               dev->mt76.txpower_conf -= 6;
+               dev->txpower_conf -= 6;
 
                if (test_bit(MT76_STATE_RUNNING, &dev->mphy.state))
                        mt76x2_phy_set_txpower(dev);