From 0c3ef988d8dca458a8f765b14c0b66ff919288c8 Mon Sep 17 00:00:00 2001 From: Sean Wang Date: Fri, 11 Nov 2022 05:23:47 +0800 Subject: [PATCH] wifi: mt76: connac: accept hw scan request at a time The current hw scan cannot accept multiple hw scan requests at a time, we return the proper error code when the hw scan is still undergoing. Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau --- mt76_connac_mcu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c index c8660fb3..dfec416e 100644 --- a/mt76_connac_mcu.c +++ b/mt76_connac_mcu.c @@ -1536,6 +1536,9 @@ int mt76_connac_mcu_hw_scan(struct mt76_phy *phy, struct ieee80211_vif *vif, struct mt76_connac_hw_scan_req *req; struct sk_buff *skb; + if (test_bit(MT76_HW_SCANNING, &phy->state)) + return -EBUSY; + skb = mt76_mcu_msg_alloc(mdev, NULL, sizeof(*req)); if (!skb) return -ENOMEM;