From nobody Sat Feb 15 23:48:16 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YwQbP6yhcz5nXKs; Sat, 15 Feb 2025 23:48:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YwQbP0CMjz3Cyp; Sat, 15 Feb 2025 23:48:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739663297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mq7DtvkOZxkWJ+EkozKPfQl4nC0YzTdGWnMOK+H3ueo=; b=A45Yw4I3rYSHEimgRoDWUwGqVOJz02wJx0BLgZ9gg/6/Efmhvw+UVkNHk/iRnHEsRkRrOE yyaou3yTcOAf7y0UafNYo5dVUjPXwnKwNVi0xt8HmNvZJ2JtvjVk6fT6DoEc0PmWGIX/B1 pi1ayqwb/h75NCJpfRtbmrrw/jdgPviA/gh1WAlMnCsOET5CgVlkXbwRI5a5sQooa4Yr4z 2pd9ZGjLdtKnAfRHZqae9LiGBuCjuCXk/DwVvyEWygF/VYaPth+H2vBrD7D4tdUZ6eo5LP pkn+AZwq167MsH+e7N2te2djNHyhEptuMx2qUDqVryZp96e0vAMNayd+jlHyKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739663297; a=rsa-sha256; cv=none; b=qSPBVfQBJ6vaEfZeopMODeJFsQceY21JviNaOQHQkQnzOhaT23ooCXM7AQHWdGqitGmCiH TRkr4POz/V0buBVPSj3rNQiobLRjbsByAj3S2mNH5WCM2PHndFBpka5dLqIPYMiOedPUV9 hMy7jESL9FySj7gI5LQ6/jm9aeO952g8qOaxshwAmovT8dbfESD2ukyC8vtBN7penjJr0R rwCJSQ+KUNFY3fqYGGKnhkl7y5w1aQdsxee5vgVPQPu6Dht4SIFi00uCndIeTu+qaOrajh Twa4s5ARzAxT5pR7zUzP01XLtTae6Z0OVuDxF/KKlNSbJW3Sa+ErajEnLydTAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739663297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mq7DtvkOZxkWJ+EkozKPfQl4nC0YzTdGWnMOK+H3ueo=; b=czJwjsj1fysnwqorBRnZDFdwArpYKp7kGoWuEw9pcmzYvf4pWbxw4cjUAncVUK4s8TYFoH XPpIxGbYNHKL55sjRPhWY2t8JQE1JHNKDDsB+WYGpZKoxN5/WSwUv73ZukC9/bhDEFOUY5 t3pgHBqfIcAJ75VVpkBabcKhjgTwOTG3RXaKVh+Q9A+hewFrwVyVEjsFgdbmnTGg8GvRGG qsoynwRhdYo+XL+4PaitF1ZSxU0L3lOJxOx+GvrAKKpxWXhE/tvuoArK6HK1v4c+cNYEC0 6qq7IUjUakbrb5O00q50P2Qb+UM3an9VWELMumOEl7yo6E+8vCn0Rjchk6D4xw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YwQbN6YbKz71P; Sat, 15 Feb 2025 23:48:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51FNmGhg040555; Sat, 15 Feb 2025 23:48:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51FNmG5h040552; Sat, 15 Feb 2025 23:48:16 GMT (envelope-from git) Date: Sat, 15 Feb 2025 23:48:16 GMT Message-Id: <202502152348.51FNmG5h040552@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: c272abc5c6a7 - main - LinuxKPI: 802.11: adjust the hw_scan channel list List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c272abc5c6a72881f1252f069d79990201559d1a Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c272abc5c6a72881f1252f069d79990201559d1a commit c272abc5c6a72881f1252f069d79990201559d1a Author: Bjoern A. Zeeb AuthorDate: 2025-02-12 23:26:24 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-15 23:22:39 +0000 LinuxKPI: 802.11: adjust the hw_scan channel list Until net80211 will grow proper scan offload with the various options needed and will allow switching the scan engine try to improve the situation if we are doing a hw_scan and the device supports SINGLE_SCAN_ON_ALL_BANDS. In that case create the channel list from our device information of supported channels rather than from the net80211 scan list. Filter out currently unsupported bands. While the general "scan EBUSY" problem remains at least in my local testing I am seeing a lot more 2 and 5 GHz band results rather than being stuck on a single band (as was also often the case with iwm for me in the past). Tested by: rene (previous version) MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 61 +++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 11 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 9d601050ba69..8c1b9d73ab56 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1,6 +1,6 @@ /*- * Copyright (c) 2020-2024 The FreeBSD Foundation - * Copyright (c) 2020-2024 Bjoern A. Zeeb + * Copyright (c) 2020-2025 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from * the FreeBSD Foundation. @@ -3267,7 +3267,6 @@ sw_scan: /* XXX want to adjust ss end time/ maxdwell? */ } else { - struct ieee80211_channel *c; struct ieee80211_scan_request *hw_req; struct linuxkpi_ieee80211_channel *lc, **cpp; struct cfg80211_ssid *ssids; @@ -3284,14 +3283,31 @@ sw_scan: band_mask = 0; nchan = 0; - for (i = ss->ss_next; i < ss->ss_last; i++) { - nchan++; - band = lkpi_net80211_chan_to_nl80211_band( - ss->ss_chans[ss->ss_next + i]); - band_mask |= (1 << band); - } - - if (!ieee80211_hw_check(hw, SINGLE_SCAN_ON_ALL_BANDS)) { + if (ieee80211_hw_check(hw, SINGLE_SCAN_ON_ALL_BANDS)) { +#if 0 /* Avoid net80211 scan lists until it has proper scan offload support. */ + for (i = ss->ss_next; i < ss->ss_last; i++) { + nchan++; + band = lkpi_net80211_chan_to_nl80211_band( + ss->ss_chans[ss->ss_next + i]); + band_mask |= (1 << band); + } +#else + /* Instead we scan for all channels all the time. */ + for (band = 0; band < NUM_NL80211_BANDS; band++) { + switch (band) { + case NL80211_BAND_2GHZ: + case NL80211_BAND_5GHZ: + break; + default: + continue; + } + if (hw->wiphy->bands[band] != NULL) { + nchan += hw->wiphy->bands[band]->n_channels; + band_mask |= (1 << band); + } + } +#endif + } else { IMPROVE("individual band scans not yet supported, only scanning first band"); /* In theory net80211 should drive this. */ /* Probably we need to add local logic for now; @@ -3345,9 +3361,11 @@ sw_scan: *(cpp + i) = (struct linuxkpi_ieee80211_channel *)(lc + i); } +#if 0 /* Avoid net80211 scan lists until it has proper scan offload support. */ for (i = 0; i < nchan; i++) { - c = ss->ss_chans[ss->ss_next + i]; + struct ieee80211_channel *c; + c = ss->ss_chans[ss->ss_next + i]; lc->hw_value = c->ic_ieee; lc->center_freq = c->ic_freq; /* XXX */ /* lc->flags */ @@ -3356,6 +3374,27 @@ sw_scan: /* lc-> ... */ lc++; } +#else + for (band = 0; band < NUM_NL80211_BANDS; band++) { + struct ieee80211_supported_band *supband; + struct linuxkpi_ieee80211_channel *channels; + + /* Band disabled for scanning? */ + if ((band_mask & (1 << band)) == 0) + continue; + + /* Nothing to scan in band? */ + supband = hw->wiphy->bands[band]; + if (supband == NULL || supband->n_channels == 0) + continue; + + channels = supband->channels; + for (i = 0; i < supband->n_channels; i++) { + *lc = channels[i]; + lc++; + } + } +#endif hw_req->req.n_ssids = ssid_count; if (hw_req->req.n_ssids > 0) {