From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=46.4.11.11 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795980704; b=XsIrPmrNthcIEFjbXpePWcvFpf+eWbTz0DejmKwyf43/QhkocnDN6FNG/31GRJfRU2qU KsXs2rl5aAuZKQVpOTnA7E+OmknwKlc9qtuYVZFmB4T6zXmTnusiFY3OvOVfI5cGqMEXA LOvkXN//fA67Khh3GXNS8zShZ6ZkBeX86ANZoeO0T1Q+0k0GwiQcnat22wA5l6+REmLSX mvor6PMEdbAzqWIxQNaVAbwT99wut8ej5M4xogJ77e1Z2NWjZgOGDpfNAe4Sy3xPUvhBN dblmJQMVadxDpsLUysua8w+/wAsfcMTXuxwGSH3queC8ZEd3wHllxMB+dxABQ1oaeMw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795980704; h=DMARC-Filter:DKIM-Signature:Received:From:To:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=26+tDD7EFNo28Q+B6gsEqsE+9+7A9w0/9LFTWfi5OrE=; b=UF3S/BZjucpI2GmVpca6ruZZq2VifTvgIjHVnpROpfFm7zFCi214rrBzSuiT1wGFG3rX p5ve+KTD0SQNKQKiCoq4ynU1eXt6ngokIYv8BgRZ3vAAr0P8Qbj7gsRB8XQWURS2LDYdx CeYCb5vWP+P0hm9xDEbHEsLGDqD9IikbJJ01XV3p3wcYnQ6Kqw4ks674qI/TO3PIJTWr8 gJF7gT/hLk8SKfb626QFZGeZgFiY3EyFy8WiaJw8A8K9bf0KAvgkgulD666UemJoaA69f ZcifccT5jJxpd9NSJ4d6jTiSg8GodIC1Ffv9clqRmZlGHAQ/MQG33gVrFCowu7PYMHw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=nbd.name; spf=pass smtp.mailfrom=nbd.name; dkim=pass header.d=nbd.name header.i=@nbd.name header.a=rsa-sha256 header.s=20160729 header.b=D4KS9JSL; arc=none smtp.remote-ip=46.4.11.11 Received: from nbd.name (nbd.name [46.4.11.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 206E8606A6BF for ; Sun, 29 Nov 2026 19:31:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 206E8606A6BF Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nbd.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nbd.name header.i=@nbd.name header.a=rsa-sha256 header.s=20160729 header.b=D4KS9JSL DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=26+tDD7EFNo28Q+B6gsEqsE+9+7A9w0/9LFTWfi5OrE=; b=D4KS9JSL6K5kFDe6t5MC/L34bE T75c1iI6Tdhj6U4rDQdLHR0X8eh9/3se5gb9Oo8cPiOctChyHPN8shsTQs/ngj9r30GgL8zDazRo4 Z/EdMi2tQ3x/C7Q14A1TPIDKoLmzvIyvNp/SdkKWRvPtN4WOaNLKeXCS5uaMX8zhJBnk=; Received: from p200300cadf03580000000000000005bb.dip0.t-ipconnect.de ([2003:ca:df03:5800::5bb] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1xXkca-009vfL-29 for linux-wireless@vger.kernel.org; Sun, 29 Nov 2026 20:31:36 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH mt76-next 20/20] wifi: mt76: connac: apply the dwell time of a scan request on mt7663 Date: Sun, 29 Nov 2026 20:31:30 +0100 Message-ID: <20261129193131.3367661-20-nbd@nbd.name> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261129193131.3367661-1-nbd@nbd.name> References: <20261129193131.3367661-1-nbd@nbd.name> X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit mt7615_init_wiphy() advertises NL80211_EXT_FEATURE_SET_SCAN_DWELL, but mt76_connac_mcu_hw_scan() ignores the duration of the scan request. On mt7663 the dwell time per channel is a fixed value, whatever duration the request asks for. Pass the duration of the request, converted to ms, as the minimum and the maximum dwell time, and size the scan timeout from it. A request without a duration keeps the fixed value. The connac2 chips keep the firmware dwell time, since their firmware does not take one from the driver, see commit 9db419f0cb39 ("mt76: mt7921: fix the dwell time control"). Fixes: fcdfc29e58ee ("mt76: mt7615: introduce hw scan support") Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c index 56b4a0940bb1..230487da1ccf 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c @@ -1891,7 +1891,10 @@ int mt76_connac_mcu_hw_scan(struct mt76_phy *phy, struct ieee80211_vif *vif, /* increase channel time for passive scan */ if (!sreq->n_ssids) duration *= 2; - req->timeout_value = cpu_to_le16(sreq->n_channels * duration); + if (sreq->duration && !is_connac2(phy->dev)) + duration = mt76_connac_mcu_scan_dwell(sreq); + req->timeout_value = cpu_to_le16(min_t(u32, sreq->n_channels * duration, + U16_MAX)); req->channel_min_dwell_time = cpu_to_le16(duration); req->channel_dwell_time = cpu_to_le16(duration); -- 2.47.3