Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3292233rwb; Mon, 15 Aug 2022 23:25:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR7R+JbFdUrKNwoO831MCinF0ZjgLmniq9G9NAU9qzOVTGTa4qgkQ3mm8oFPe8PSXU/QwU0/ X-Received: by 2002:a05:6a00:230f:b0:52f:6734:90fe with SMTP id h15-20020a056a00230f00b0052f673490femr20089734pfh.67.1660631100325; Mon, 15 Aug 2022 23:25:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660631100; cv=none; d=google.com; s=arc-20160816; b=mPDCQbStuiUnQJURValKSgX+uit4Kj4vCBHtgttlIy+BkejkXMJ5kfgABOd9rITZY/ obPzJyBJtyu5D6HgWDo2vnFGSY2Dd8Cu/Q7QfBIP6VBimHNNvCwO1YfTPOH1CC8/4xQg kHg2xxSt5fsVKbUVeED7GbuCG2Eqt2UnklDs/AujI7lavy3WthNfq8oMV+b8hR5Lr/Dg J8n8w1TT2M3OwIQCrZfUYwaf28aZcKGVc55nCtMGxAVWUK5kRoaxnJ1tN2YYtV+MDOK5 NDRuwStWMmbhv8KXKqYp7/esWupkz9nSZL6Aw+EcHlusBc+6ps4LKvF6mziZFR3NqIzR QmxA== 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=iPlojUoTV6eO5+XQEy/h8OUvuvUoALvHcaSlna0fkI0=; b=K5Uae0T+H+WSsrLdswSwnhrWocoV3EG/yBWyEBh+HLgcJ1ug8X4uEIryH736988s2e 5HbsRLvLwY48Z3QvWNDQ/hrvxjeDonPoK26kux7wgq4fLZLpqXNp2OAXWdimlU8lPyav S48SSZlIYe2u8C2iAcdXVrD1bUYrb/WJ93Kz7MNAHO8DKiEPsuXJJIb2r4l8LRQZ+A4p r6jaQJY2rB/Pv5d+7bVDsVxu+JDIVgCx6+rcw0dJhQIuXZsOlQOV/CCCefLCn7KQYA04 Ax9CWjiImstt/s63cTeGsNxrLzmjc5o5E9zz1C1F8Ns1zv7Lf6bKF+Rhk5lNXsgHWzX+ joBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=hdD90ltr; 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 r66-20020a632b45000000b0041cea5fee28si13049627pgr.748.2022.08.15.23.24.52; Mon, 15 Aug 2022 23:25:00 -0700 (PDT) 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=hdD90ltr; 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 S229516AbiHPGT0 (ORCPT + 65 others); Tue, 16 Aug 2022 02:19:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229820AbiHPGTG (ORCPT ); Tue, 16 Aug 2022 02:19:06 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA5954F663 for ; Mon, 15 Aug 2022 17:04:28 -0700 (PDT) X-UUID: 00b31936d68d497b807add5633fcb570-20220816 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=iPlojUoTV6eO5+XQEy/h8OUvuvUoALvHcaSlna0fkI0=; b=hdD90ltrCgmxB5kqpElENaD7gKOY4cpWLYDQv2LBRXvl7daN2gRzG5+0Ak/+h3pHAdeUXpFtK32d22EzxxhYe7TI9uaZH+hb5djO/DTyZMfae1WbwosN4L3+jqi0ukkZfVVW1XEHR+ZegYtTDb0zYg8d3dQBHgIkvXcvzrL/pVg=; X-CID-UNFAMILIAR: 1 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.9,REQID:3bf19847-15d6-47f3-9411-a1c41d5226b7,OB:0,LO B:0,IP:0,URL:5,TC:0,Content:0,EDM:0,RT:0,SF:100,FILE:0,BULK:0,RULE:Release _Ham,ACTION:release,TS:105 X-CID-INFO: VERSION:1.1.9,REQID:3bf19847-15d6-47f3-9411-a1c41d5226b7,OB:0,LOB: 0,IP:0,URL:5,TC:0,Content:0,EDM:0,RT:0,SF:100,FILE:0,BULK:0,RULE:Spam_GS98 1B3D,ACTION:quarantine,TS:105 X-CID-META: VersionHash:3d8acc9,CLOUDID:5f1463fd-9e71-4a0f-ba6b-417998daea35,C OID:7a568cdc3c9b,Recheck:0,SF:28|16|19|48,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 00b31936d68d497b807add5633fcb570-20220816 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1633658602; Tue, 16 Aug 2022 08:04:22 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Tue, 16 Aug 2022 08:04:20 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 16 Aug 2022 08:04:20 +0800 From: To: , CC: , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH 7/9] wifi: mt76: connac: accept hw scan request at a time Date: Tue, 16 Aug 2022 08:03:45 +0800 Message-ID: <51d7ac3d29f5a6817265ba4c3bfd0d013dbc35ed.1660606893.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,T_SCC_BODY_TEXT_LINE,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 c2ed5e755893..0ade122de632 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/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; -- 2.25.1