From patchwork Thu Nov 10 21:23:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 13039390 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B2521C4332F for ; Thu, 10 Nov 2022 21:55:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:CC:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RpuaaJKKh9YbLdcKl0fEmI69RN38zDuCkhoX9nQ/iHA=; b=SVyTfMnqoCK/LVRw2wr7M0SIrH VhIP3b34xrSXT/1ARd/8BxgHPA36EuiKaPtbSItVpOWDdnO0hXntmt7zqoFO1blkePUGEYId4Slab RNDGZXQQIn3kWwHRfOjdYlx3G4ZkuOH00Uzuo/PXhvdBayN5Xj3t5TS/WVHVMJWipIWDu0iExmA7x W/RsyprRyqIjuvWN3aAEiLwB/3swb2aNKnoO8rs4wRUhfVO2MWDPF29cJC+zjDaM71K5w40UvAIda OVnUBqchzGDHzTxIekUfqjik3FMaadwqo7VoGj6X67C0EkyMd9r3zsRmBq7ERlQVDrkSMuAaalrch bIV7Qmow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1otFVe-00AZhT-SO; Thu, 10 Nov 2022 21:54:54 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1otFVc-00AZgw-Tv for linux-mediatek@lists.infradead.org; Thu, 10 Nov 2022 21:54:54 +0000 X-UUID: 16ed2133f008471d91ae04c3854fa112-20221110 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:7000b54a-3c34-4635-ae50-e3cc3bb8adf6,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:62cd327,CLOUDID:228a375d-100c-4555-952b-a62c895efded,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 16ed2133f008471d91ae04c3854fa112-20221110 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1466123561; Thu, 10 Nov 2022 14:54:46 -0700 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 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221110_135452_991704_43EA1FCB X-CRM114-Status: GOOD ( 10.40 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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;