/* enable vco */
mt76x0_rf_set(dev, MT_RF(0, 4), BIT(7));
- if (scan)
+ if (scan) {
+ mt76x02_edcca_init(dev, false);
return 0;
+ }
mt76x02_init_agc_gain(dev);
mt76x0_phy_calibrate(dev, false);
mt76x0_phy_set_txpower(dev);
- mt76x02_edcca_init(dev);
+ mt76x02_edcca_init(dev, true);
ieee80211_queue_delayed_work(dev->mt76.hw, &dev->cal_work,
MT_CALIBRATE_INTERVAL);
tasklet_disable(&dfs_pd->dfs_tasklet);
dev->ed_monitor = region == NL80211_DFS_ETSI;
- mt76x02_edcca_init(dev);
+ mt76x02_edcca_init(dev, true);
dfs_pd->region = region;
mt76x02_dfs_init_params(dev);
dev->ed_tx_blocked = !enable;
}
-void mt76x02_edcca_init(struct mt76x02_dev *dev)
+void mt76x02_edcca_init(struct mt76x02_dev *dev, bool enable)
{
dev->ed_trigger = 0;
dev->ed_silent = 0;
- if (dev->ed_monitor) {
+ if (dev->ed_monitor && enable) {
struct ieee80211_channel *chan = dev->mt76.chandef.chan;
u8 ed_th = chan->band == NL80211_BAND_5GHZ ? 0x0e : 0x20;
void mt76x02_mac_set_beacon_enable(struct mt76x02_dev *dev,
struct ieee80211_vif *vif, bool val);
-void mt76x02_edcca_init(struct mt76x02_dev *dev);
+void mt76x02_edcca_init(struct mt76x02_dev *dev, bool enable);
#endif
mt76_wr(dev, MT_BBP(AGC, 2), 0x00007070);
mt76_wr(dev, MT_TXOP_CTRL_CFG, 0x04101B3F);
- if (scan)
+ if (scan) {
+ mt76x02_edcca_init(dev, false);
return 0;
+ }
mt76x2_phy_channel_calibrate(dev, true);
mt76x02_init_agc_gain(dev);
0x38);
}
- mt76x02_edcca_init(dev);
+ mt76x02_edcca_init(dev, true);
ieee80211_queue_delayed_work(mt76_hw(dev), &dev->cal_work,
MT_CALIBRATE_INTERVAL);