break;
rxd = (struct mt7615_mcu_rxd *)skb->data;
- if (rxd->eid == MCU_EVENT_SCAN_DONE) {
+ if (rxd->eid == MCU_EVENT_SCHED_SCAN_DONE) {
+ ieee80211_sched_scan_results(phy->mt76->hw);
+ } else if (test_and_clear_bit(MT76_HW_SCANNING,
+ &phy->mt76->state)) {
struct cfg80211_scan_info info = {
.aborted = false,
};
- clear_bit(MT76_HW_SCANNING, &phy->mt76->state);
ieee80211_scan_completed(phy->mt76->hw, &info);
- } else {
- ieee80211_sched_scan_results(phy->mt76->hw);
}
dev_kfree_skb(skb);
}
{
struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv;
struct mt7615_dev *dev = phy->dev;
- struct cfg80211_scan_info info = {
- .aborted = true,
- };
struct {
u8 seq_num;
u8 is_ext_channel;
.seq_num = mvif->scan_seq_num,
};
- ieee80211_scan_completed(phy->mt76->hw, &info);
- clear_bit(MT76_HW_SCANNING, &phy->mt76->state);
+ if (test_and_clear_bit(MT76_HW_SCANNING, &phy->mt76->state)) {
+ struct cfg80211_scan_info info = {
+ .aborted = true,
+ };
+
+ ieee80211_scan_completed(phy->mt76->hw, &info);
+ }
return __mt76_mcu_send_msg(&dev->mt76, MCU_CMD_CANCEL_HW_SCAN, &req,
sizeof(req), false);