mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: mt7925: refine the txpower initialization flow
Refactor the initialization and reset flow for tx power setting to eliminate redundant configurations Signed-off-by: Ming Yen Hsieh <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
015349622b
commit
5776b32929
+4
-1
@@ -1303,7 +1303,6 @@ void mt7925_mac_reset_work(struct work_struct *work)
|
||||
cancel_delayed_work_sync(&dev->mphy.mac_work);
|
||||
cancel_delayed_work_sync(&pm->ps_work);
|
||||
cancel_work_sync(&pm->wake_work);
|
||||
dev->sar_inited = false;
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
@@ -1332,6 +1331,10 @@ void mt7925_mac_reset_work(struct work_struct *work)
|
||||
IEEE80211_IFACE_ITER_RESUME_ALL,
|
||||
mt7925_vif_connect_iter, NULL);
|
||||
mt76_connac_power_save_sched(&dev->mt76.phy, pm);
|
||||
|
||||
mt792x_mutex_acquire(dev);
|
||||
mt7925_mcu_set_clc(dev, "00", ENVIRON_INDOOR);
|
||||
mt792x_mutex_release(dev);
|
||||
}
|
||||
|
||||
void mt7925_coredump_work(struct work_struct *work)
|
||||
|
||||
@@ -311,7 +311,6 @@ void mt7925_set_stream_he_eht_caps(struct mt792x_phy *phy)
|
||||
int __mt7925_start(struct mt792x_phy *phy)
|
||||
{
|
||||
struct mt76_phy *mphy = phy->mt76;
|
||||
struct mt792x_dev *dev = phy->dev;
|
||||
int err;
|
||||
|
||||
err = mt7925_mcu_set_channel_domain(mphy);
|
||||
@@ -322,13 +321,6 @@ int __mt7925_start(struct mt792x_phy *phy)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (!dev->sar_inited) {
|
||||
err = mt7925_set_tx_sar_pwr(mphy->hw, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
dev->sar_inited = true;
|
||||
}
|
||||
|
||||
mt792x_mac_reset_counters(phy);
|
||||
set_bit(MT76_STATE_RUNNING, &mphy->state);
|
||||
|
||||
@@ -1680,13 +1672,7 @@ static int mt7925_set_sar_specs(struct ieee80211_hw *hw,
|
||||
int err;
|
||||
|
||||
mt792x_mutex_acquire(dev);
|
||||
err = mt7925_mcu_set_clc(dev, dev->mt76.alpha2,
|
||||
dev->country_ie_env);
|
||||
if (err < 0)
|
||||
goto out;
|
||||
|
||||
err = mt7925_set_tx_sar_pwr(hw, sar);
|
||||
out:
|
||||
mt792x_mutex_release(dev);
|
||||
|
||||
return err;
|
||||
|
||||
+3
-2
@@ -759,7 +759,6 @@ static int mt7925_load_clc(struct mt792x_dev *dev, const char *fw_name)
|
||||
}
|
||||
}
|
||||
|
||||
ret = mt7925_mcu_set_clc(dev, "00", ENVIRON_INDOOR);
|
||||
out:
|
||||
release_firmware(fw);
|
||||
|
||||
@@ -3728,6 +3727,8 @@ out:
|
||||
|
||||
int mt7925_mcu_set_rate_txpower(struct mt76_phy *phy)
|
||||
{
|
||||
struct mt76_dev *mdev = phy->dev;
|
||||
struct mt792x_dev *dev = mt792x_hw_dev(mdev->hw);
|
||||
int err;
|
||||
|
||||
if (phy->cap.has_2ghz) {
|
||||
@@ -3744,7 +3745,7 @@ int mt7925_mcu_set_rate_txpower(struct mt76_phy *phy)
|
||||
return err;
|
||||
}
|
||||
|
||||
if (phy->cap.has_6ghz) {
|
||||
if (phy->cap.has_6ghz && dev->phy.clc_chan_conf) {
|
||||
err = mt7925_mcu_rate_txpower_band(phy,
|
||||
NL80211_BAND_6GHZ);
|
||||
if (err < 0)
|
||||
|
||||
Reference in New Issue
Block a user