aboutsummaryrefslogtreecommitdiff
path: root/scan.c
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2025-12-05 20:47:59 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2025-12-05 21:27:47 +0000
commit793e6427d9089ce2724005ea3dadd839334065ae (patch)
tree775f224bd0813f9d7db9f379dbf15282708e4461 /scan.c
parent731c85b798313a757d42a3cc9861359f47d84ed5 (diff)
mt76: update Mediatek's mt76 drivervendor/Linux/mt76/torvalds-v6.18
This version is based on git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 7d0a66e4bb9081d75c82ec4957c50034cb0ea449 ( tag: v6.18 ). Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'scan.c')
-rw-r--r--scan.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/scan.c b/scan.c
index 9b20ccbeb8cf..5a875aac410f 100644
--- a/scan.c
+++ b/scan.c
@@ -16,11 +16,13 @@ static void mt76_scan_complete(struct mt76_dev *dev, bool abort)
clear_bit(MT76_SCANNING, &phy->state);
- if (dev->scan.chan && phy->main_chandef.chan)
+ if (dev->scan.chan && phy->main_chandef.chan &&
+ !test_bit(MT76_MCU_RESET, &dev->phy.state))
mt76_set_channel(phy, &phy->main_chandef, false);
mt76_put_vif_phy_link(phy, dev->scan.vif, dev->scan.mlink);
memset(&dev->scan, 0, sizeof(dev->scan));
- ieee80211_scan_completed(phy->hw, &info);
+ if (!test_bit(MT76_MCU_RESET, &dev->phy.state))
+ ieee80211_scan_completed(phy->hw, &info);
}
void mt76_abort_scan(struct mt76_dev *dev)
@@ -28,6 +30,7 @@ void mt76_abort_scan(struct mt76_dev *dev)
cancel_delayed_work_sync(&dev->scan_work);
mt76_scan_complete(dev, true);
}
+EXPORT_SYMBOL_GPL(mt76_abort_scan);
static void
mt76_scan_send_probe(struct mt76_dev *dev, struct cfg80211_ssid *ssid)
@@ -112,9 +115,6 @@ void mt76_scan_work(struct work_struct *work)
local_bh_enable();
out:
- if (!duration)
- return;
-
if (dev->scan.chan)
duration = max_t(int, duration,
msecs_to_jiffies(req->duration +
@@ -139,7 +139,8 @@ int mt76_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
mutex_lock(&dev->mutex);
- if (dev->scan.req || phy->roc_vif) {
+ if (dev->scan.req || phy->roc_vif ||
+ test_bit(MT76_MCU_RESET, &dev->phy.state)) {
ret = -EBUSY;
goto out;
}