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=1795980703; b=I39E05fPDHgSrbwcT+uqa0s2gYFEtN3A0pp9pkgE2y8xy+yOPYhLKpAIaAboEhlC9z6h ltY7IBpjHRt9h8HASJI48TCWlb3PfYhj65j/0hZ8LrvEmZb3AoFXJvPf5h2vqjidUUUF9 OxBxDmJzG8V7OzESl5a++tVtQY1pZeeAOyFja3mMvsdP3jGkzB4oMiq9iPWacD/AmpYDt MLIS7TlgDV0NonZI32jwAYwyh0VJ2sxWjlo3WK89SaCq1Lt6yJQ2xWqs2kqxuCsjgOEwB 56j12fsmu9bXXtCOGCAIjtOKQ3KfY+Gs4YfEcEXkpf16deE7EkuymHnfpewxvwgXieA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795980703; h=DMARC-Filter:DKIM-Signature:Received:From:To:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=nowyP4WGjofD8Pod8FQje9pZkcYpjIVClrdFVcRQN30=; b=2RPuleevScGIDuNAbzI+pNFumJcwtPJI68QwZTsWsu1wiuqM6/GwzIcjHzAzcusfELjd IwQo3Y/RCVe4RHm80BKUgpuzCpPcLd/x76d64MVUPPxD5Jxv5VbT/CRckwu1RQQ4ja89/ wkEkSSHCnZZtTX+iPPdMRfw6m8tVCqBLalGnW8caz7Pub0Ftt3vPtwpZ/YyfL7HUkm+bJ /ZRvLWpBxEJHwydqCav2ReKbK0tbrHFkUraKQOvBJveiEzZg2HJKcHBsMQ1z96ZRtsglj iYzM76ErzDAWnGYTsIn6N9s1SSANU1jlQFxcvDEUupPOhrezXAOzZcGpYyxuT078i8Q== 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=Uq9CWuCW; 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 27199606A69B for ; Sun, 29 Nov 2026 19:31:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 27199606A69B 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=Uq9CWuCW 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=nowyP4WGjofD8Pod8FQje9pZkcYpjIVClrdFVcRQN30=; b=Uq9CWuCWFZgBBIJQ2nhWZkSxLW 8ABoidMf+dMiHBcuHVqHho0a4MLxWYOwVM8gOTCytP0D6Q6ijFIEknN0z4/kqxOCeekevHROO89T6 dMEWETl3cvSsJWMtI64SoKqbyiELKX5bIribjYEAGkw1b5DuByKJjf2BMQFDTyFoalXs=; 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-1d 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 19/20] wifi: mt76: mt7925: apply the dwell time of a scan request Date: Sun, 29 Nov 2026 20:31:29 +0100 Message-ID: <20261129193131.3367661-19-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 mt792x_init_wiphy() advertises NL80211_EXT_FEATURE_SET_SCAN_DWELL, but mt7925_mcu_hw_scan() ignores the duration of the scan request. Since commit efeaabc5680c ("wifi: mt76: mt7925: config the dwell time by firmware") it leaves the dwell fields of the scan command at 0, so the firmware uses its default dwell time on every channel. That default is shorter than a beacon interval. A scan for a beacon report with a duration of 150 TU thus misses APs whose beacon does not fall into the dwell and whose probe response comes late. Pass the duration of the request, converted to ms, as the minimum and the maximum dwell time. The firmware sends its probe requests only within the minimum dwell time, so both carry the same value. A request without a duration keeps the firmware default, which that commit chose for a shorter scan. Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips") Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h | 8 ++++++++ drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 3 +++ 2 files changed, 11 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h index bd0ae510202f..2ced2a526fb9 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h @@ -2093,6 +2093,14 @@ mt76_connac_mcu_he_ldpc(struct ieee80211_bss_conf *link_conf) return link_conf->vif->type != NL80211_IFTYPE_AP || link_conf->he_ldpc; } +static inline u16 +mt76_connac_mcu_scan_dwell(struct cfg80211_scan_request *sreq) +{ + return min_t(unsigned long, + ieee80211_tu_to_usec(sreq->duration) / USEC_PER_MSEC, + U16_MAX); +} + int mt76_connac_mcu_set_channel_domain(struct mt76_phy *phy); int mt76_connac_mcu_set_vif_ps(struct mt76_dev *dev, struct ieee80211_vif *vif); void mt76_connac_mcu_sta_basic_tlv(struct mt76_dev *dev, struct sk_buff *skb, diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index 86b01c522a55..f01172f01984 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -3459,6 +3459,9 @@ int mt7925_mcu_hw_scan(struct mt76_phy *phy, struct ieee80211_vif *vif, req = (struct scan_req_tlv *)tlv; req->scan_type = sreq->n_ssids ? 1 : 0; req->probe_req_num = sreq->n_ssids ? 2 : 0; + req->channel_min_dwell_time = + cpu_to_le16(mt76_connac_mcu_scan_dwell(sreq)); + req->channel_dwell_time = req->channel_min_dwell_time; tlv = mt76_connac_mcu_add_tlv(skb, UNI_SCAN_SSID, sizeof(*ssid)); ssid = (struct scan_ssid_tlv *)tlv; -- 2.47.3