blob: 420aeb0d453479faedfc17661b7a85e6887b9555 [file] [log] [blame]
developerbbd45e12023-05-19 08:22:06 +08001From c32e29ad8916241b5a0bdc5f662e766687524327 Mon Sep 17 00:00:00 2001
developer4f4219d2023-05-17 18:09:47 +08002From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
3Date: Wed, 17 May 2023 17:34:55 +0800
developerbbd45e12023-05-19 08:22:06 +08004Subject: [PATCH 6/6] wifi: mt76: mt7915: fix DFS CAC tx emission issue after
developer4f4219d2023-05-17 18:09:47 +08005 interface down up
6
7FW's channel state is set during the first wifi interface setup. If the switch reason for
8setting the tx/rx path during second-time wifi interface setup is CH_SWITCH_NORMAL,
9then the FW would perform runtime dpd channel calibration during DFS CAC, which leads to
10tx emission. Therefore, in order to bypass tx calibration during DFS CAC, set the switch reason
11to CH_SWITCH_DFS whenever chandef is set to DFS channel.
12
13Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
14---
15 mt7915/mcu.c | 6 +++---
16 1 file changed, 3 insertions(+), 3 deletions(-)
17
18diff --git a/mt7915/mcu.c b/mt7915/mcu.c
developerbbd45e12023-05-19 08:22:06 +080019index 8d8a203..9dd4e34 100644
developer4f4219d2023-05-17 18:09:47 +080020--- a/mt7915/mcu.c
21+++ b/mt7915/mcu.c
developerbbd45e12023-05-19 08:22:06 +080022@@ -2693,12 +2693,12 @@ int mt7915_mcu_set_chan_info(struct mt7915_phy *phy, int cmd)
developer4f4219d2023-05-17 18:09:47 +080023 if (mt76_connac_spe_idx(phy->mt76->antenna_mask))
24 req.tx_path_num = fls(phy->mt76->antenna_mask);
25
26- if (cmd == MCU_EXT_CMD(SET_RX_PATH) ||
27- dev->mt76.hw->conf.flags & IEEE80211_CONF_MONITOR)
28+ if (dev->mt76.hw->conf.flags & IEEE80211_CONF_MONITOR)
29 req.switch_reason = CH_SWITCH_NORMAL;
30 else if (phy->mt76->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)
31 req.switch_reason = CH_SWITCH_SCAN_BYPASS_DPD;
32- else if (!cfg80211_reg_can_beacon(phy->mt76->hw->wiphy, chandef,
33+ else if (cfg80211_chandef_valid(chandef) &&
34+ !cfg80211_reg_can_beacon(phy->mt76->hw->wiphy, chandef,
35 NL80211_IFTYPE_AP))
36 req.switch_reason = CH_SWITCH_DFS;
37 else
38--
392.18.0
40