Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1256312rwb; Thu, 10 Nov 2022 13:30:59 -0800 (PST) X-Google-Smtp-Source: AMsMyM4sd8Yg0YkGs4txjDlh19+rviUdOHzFSJ9GKZKw0/UMbm6qErmsUtEHZ2HAKAlLZ7FcDKEH X-Received: by 2002:aa7:ca41:0:b0:462:3340:757b with SMTP id j1-20020aa7ca41000000b004623340757bmr3527257edt.308.1668115859652; Thu, 10 Nov 2022 13:30:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668115859; cv=none; d=google.com; s=arc-20160816; b=KDCN5U8AxqZA6vUGeWGKOWd2AVCjp26yNdcFRiF6m9ST1fWl+u7/WL4173DiLdUr+g ULp7yM+Vn1b+6FkJTL6Nw8vWhchZ/WaCV5CgX0Lgam8N4dCCtRytTi7Imbr4y9LJ6b7k VWq16sRgiQrLmjCK5nPNV4bd3evzEVvExHOCaxNMhXtoPhF5O1FEMnIhyp+Gke2DoYzf Dj6YjQKPtiuk3tfEftA0l15JDwEyB+wZnrvcxoIlJ4Wj/SU4xwRUCNLqOunAC89UrcaZ XNvgBEHvvet+gIPjWH7YIgg6rDHVNjimjioQUhAAeQnwmYHRhfF4rOxZIksrR0syRqPK TzKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=RpuaaJKKh9YbLdcKl0fEmI69RN38zDuCkhoX9nQ/iHA=; b=eQGhtVFO8r/M41BR92fiqXgcGlcIgQigDp6oiUvbTAxZqttWtMrbRAJwuLADoliXwf mYMPEtJVUUl0uYgdSALkk+DPL2ACb3Tx2ArNYIQmjraimccLsJBRTW3mywKHgs+m9PEA PRIUeMerReGQNW6EVkgvt4ZN1aDPAfBMArT3m2ZfYm6km36trHdgxTWKNmPHlSWkJxl4 3KsU5H78aZvxSHEX52zR6yopjfIGsusdoez3XLny/wSdQEc2SaHKPceElCxsoYuF/XW0 T8LYKYj8hbqZLL9Q7eV/iy791S5UZA63z7znLQLC18ZWiAgkiJesZkbbHiWbwPCAv5tD b8Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=c+nEy968; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w10-20020a170906384a00b007adc8d6b77esi278263ejc.308.2022.11.10.13.30.42; Thu, 10 Nov 2022 13:30:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=c+nEy968; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231382AbiKJVZO (ORCPT + 66 others); Thu, 10 Nov 2022 16:25:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232795AbiKJVYk (ORCPT ); Thu, 10 Nov 2022 16:24:40 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 328995F847 for ; Thu, 10 Nov 2022 13:24:15 -0800 (PST) X-UUID: 61c343714e5942ca83e5c917f832578c-20221111 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=RpuaaJKKh9YbLdcKl0fEmI69RN38zDuCkhoX9nQ/iHA=; b=c+nEy968qLFUwAT4cM8vu4k6xPxxtAKi+eD8RnSxTkdGBLd8qSYsQxySrIWg471Pd+bE2AnKO8HdsT6IXlYsv326GNcWyfdyWtNQ14XwweJ5Q8BGvH6O7iem1SijSZLODfM2zbyYai/h9FIAW+3CXeNgfh4lwM6ydyaX6EGfAC8=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.12,REQID:d0a88b43-6334-4e49-a539-32729c6fcf9c,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:90 X-CID-INFO: VERSION:1.1.12,REQID:d0a88b43-6334-4e49-a539-32729c6fcf9c,IP:0,URL :0,TC:0,Content:-5,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTIO N:quarantine,TS:90 X-CID-META: VersionHash:62cd327,CLOUDID:4898f350-b7af-492d-8b40-b1032f90ce11,B ulkID:2211110524102DIX7N2H,BulkQuantity:0,Recheck:0,SF:38|28|17|19|48,TC:n il,Content:0,EDM:-3,IP:nil,URL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 61c343714e5942ca83e5c917f832578c-20221111 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 38854946; Fri, 11 Nov 2022 05:24:08 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Fri, 11 Nov 2022 05:24:07 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Fri, 11 Nov 2022 05:24:07 +0800 From: To: , CC: , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v3 5/7] wifi: mt76: connac: accept hw scan request at a time Date: Fri, 11 Nov 2022 05:23:47 +0800 Message-ID: <08ac9b252890eb9a41decba696040c2bd5f07492.1668068326.git.objelf@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Sean Wang 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 --- drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c index fffdb6976e52..e5c925ec8691 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c @@ -1537,6 +1537,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; -- 2.25.1