summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2022-02-24 14:34:33 +0100
committerFelix Fietkau <nbd@nbd.name>2022-02-24 14:40:23 +0100
commit00a883e6806e394638d344ba281c2727d6ffcbd4 (patch)
treebbb6971828823a468f6776300b6dc72756db2208 /drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
parentb1481b336d3ccdbef5dd73c747d7709f5431c404 (diff)
downloadlinux-stable-00a883e6806e394638d344ba281c2727d6ffcbd4.tar.gz
linux-stable-00a883e6806e394638d344ba281c2727d6ffcbd4.tar.bz2
linux-stable-00a883e6806e394638d344ba281c2727d6ffcbd4.zip
mt76: fix dfs state issue with 160 MHz channels
When operating on a mix of DFS and non-DFS channels, the driver only checks the CAC status of the control channel. This causes beacons/tx to fail if the control channel is on a non-DFS channel. Fix this by calling cfg80211_reg_can_beacon to determine the DFS status of all affected channels Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7615/mcu.c')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7615/mcu.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
index 120760ea1c89..e98c6076a633 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
@@ -2151,10 +2151,12 @@ int mt7615_mcu_set_chan_info(struct mt7615_phy *phy, int cmd)
.center_chan2 = ieee80211_frequency_to_channel(freq2),
};
- if (phy->mt76->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)
+ if (cmd == MCU_EXT_CMD(SET_RX_PATH))
+ req.switch_reason = CH_SWITCH_NORMAL;
+ else if (phy->mt76->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)
req.switch_reason = CH_SWITCH_SCAN_BYPASS_DPD;
- else if ((chandef->chan->flags & IEEE80211_CHAN_RADAR) &&
- chandef->chan->dfs_state != NL80211_DFS_AVAILABLE)
+ else if (!cfg80211_reg_can_beacon(phy->mt76->hw->wiphy, chandef,
+ NL80211_IFTYPE_AP))
req.switch_reason = CH_SWITCH_DFS;
else
req.switch_reason = CH_SWITCH_NORMAL;