From patchwork Tue May 12 20:02:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 215623 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D05EC2D0F8 for ; Tue, 12 May 2020 20:03:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4CDB520731 for ; Tue, 12 May 2020 20:03:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589313783; bh=MTUCgk4rciCF//7GPnewL+9mWSnuMUcygZkcZVrYiaY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=kNKyeJpAewv68C+Cn/3vUHzJb448p9aK8SWdUa9WJQwLuyKLVz3KKu/xucgAgMaHY ggee0DpSmXuZGbUhGrT85jIYOyfReJbxUwQUwQzRILRkBR2GQ6mg/wAOKWTlznXdvx woOVF1hwHtbR7H44KfsCX/O5mCBG4Gn9QkYvDtkk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731020AbgELUDC (ORCPT ); Tue, 12 May 2020 16:03:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:51198 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725987AbgELUDC (ORCPT ); Tue, 12 May 2020 16:03:02 -0400 Received: from localhost.localdomain.com (unknown [151.48.155.206]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EA522206D6; Tue, 12 May 2020 20:03:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589313782; bh=MTUCgk4rciCF//7GPnewL+9mWSnuMUcygZkcZVrYiaY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SQQF9BGVhVWeeh9XhG7JrHi/dK/Ipqhycgmc/XKAMuSjIHF+8+EgUPWYuZUYme8WP 6yPZdQR+SVhn2gGaDzr61xCP3CIAzw+31FZTPr+7PggNiEGoNJFeiCunS1dUOtKFje f8EfUaQvpwLirNgCM8Rk/643Acw4onN2JdokbLTI= From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org, lorenzo.bianconi@redhat.com, sean.wang@mediatek.com, linux-mediatek@lists.infradead.org Subject: [PATCH 2/4] mt76: mt7615: reduce hw scan timeout Date: Tue, 12 May 2020 22:02:48 +0200 Message-Id: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Differentiate hw scan channel time between passive and active scan Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index 9cb8a9bb912b..e9ae7e94d8fd 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -2773,7 +2773,7 @@ int mt7615_mcu_set_channel_domain(struct mt7615_phy *phy) MCU_CMD_SET_CHAN_DOMAIN, false); } -#define MT7615_SCAN_CHANNEL_TIME 120 +#define MT7615_SCAN_CHANNEL_TIME 60 int mt7615_mcu_hw_scan(struct mt7615_phy *phy, struct ieee80211_vif *vif, struct ieee80211_scan_request *scan_req) { @@ -2819,6 +2819,9 @@ int mt7615_mcu_hw_scan(struct mt7615_phy *phy, struct ieee80211_vif *vif, req->ssid_type = n_ssids ? BIT(2) : BIT(0); req->ssids_num = n_ssids; + /* increase channel time for passive scan */ + if (!sreq->n_ssids) + duration *= 2; req->timeout_value = cpu_to_le16(sreq->n_channels * duration); req->channel_min_dwell_time = cpu_to_le16(duration); req->channel_dwell_time = cpu_to_le16(duration);