mt76: fix dfs state issue with 160 MHz channels
[linux-2.6-microblaze.git] / drivers / net / wireless / mediatek / mt76 / mt7915 / mcu.c
index 8c01429..119f935 100644 (file)
@@ -2811,10 +2811,12 @@ int mt7915_mcu_set_chan_info(struct mt7915_phy *phy, int cmd)
        }
 #endif
 
-       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 (phy->mt76->hw->conf.radar_enabled &&
-                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;