Skip to content

Commit

Permalink
wifi: mt76: mt7921: fix wrong power after multiple SAR set
Browse files Browse the repository at this point in the history
[ Upstream commit 7eefb93 ]

We should update CLC config before SAR set to synchronize all
related settings.

Fixes: 23bdc5d ("wifi: mt76: mt7921: introduce Country Location Control support")
Signed-off-by: YN Chen <YN.Chen@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
YN Chen authored and gregkh committed Dec 31, 2022
1 parent 71e73d3 commit f11c5a1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/wireless/mediatek/mt76/mt7921/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ mt7921_regd_notifier(struct wiphy *wiphy,

memcpy(dev->mt76.alpha2, request->alpha2, sizeof(dev->mt76.alpha2));
dev->mt76.region = request->dfs_region;
dev->country_ie_env = request->country_ie_env;

mt7921_mutex_acquire(dev);
mt7921_mcu_set_clc(dev, request->alpha2, request->country_ie_env);
Expand Down
6 changes: 6 additions & 0 deletions drivers/net/wireless/mediatek/mt76/mt7921/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,13 @@ static int mt7921_set_sar_specs(struct ieee80211_hw *hw,
int err;

mt7921_mutex_acquire(dev);
err = mt7921_mcu_set_clc(dev, dev->mt76.alpha2,
dev->country_ie_env);
if (err < 0)
goto out;

err = mt7921_set_tx_sar_pwr(hw, sar);
out:
mt7921_mutex_release(dev);

return err;
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ struct mt7921_dev {
struct work_struct ipv6_ns_work;
/* IPv6 addresses for WoWLAN */
struct sk_buff_head ipv6_ns_list;

enum environment_cap country_ie_env;
};

enum {
Expand Down

0 comments on commit f11c5a1

Please sign in to comment.