From nobody Mon Feb 24 20:27:08 2025 X-Original-To: dev-commits-src-all@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 4Z1sj91LQfz5pptK; Mon, 24 Feb 2025 20:27:09 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sj85sN7z3nn5; Mon, 24 Feb 2025 20:27:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428828; 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=8PeaQyGTimWYxlcmAEee5c/n8h9wOQZsIJGkyfxJB6A=; b=ZpggzUoycjDn+XrHcDGJoDnyBFAXWgUeBk5gRe6wQM855tZpl3viWNm1+hRsSoEWC84s4q Ax4LXvq2mwYDJACGWfYJ17b6/BbGMgvfgWkEDIHCefWJj8HAUCYkoCjg66qLqux6B8RnAc EnuySnx43vHhN65ZJsi0fCZP/zmdiSjtIg03cqEf6B/jEpRWYjXLkvS+lCLcJ6uuXRkC9m 6gc/J7HYAc/RtdPKp/k5N4+0CRnI0GN8SU1jqbLKqccsWpDM91BEotXaX6qtziAI9yMslg uFXoW0kTZtpmb9sd2WIKcnHwBk5Ep27vG7UqoJi+0g6TiXQxDGoiEAuDgHIQeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428828; a=rsa-sha256; cv=none; b=JgDfOE3VEdFqYWVokmPazh+j4XvLebfPezX/VIn1I78zfVTecbBjaky54bf9nJ6cEMyO0j t5IWLj6IfN+k0V4ydEk4IZO6/GnJ7VtGp30DBOfYns/2Lk/tT4UZyIXOzKdArm4tGHQQCy 4Owaavr4Kcfy9K9S8Xch31tpP6s6Gi3upbbMzVQ+D6Ma17WjfeSxI2ghRKrnKqma+SVXR3 feEUB43yU1te1AhDzEA0JqG886dDgQ6cnReO6oHsqQJSjS0CAzVb+TPtJB2nmW8KvL9pTH mN2oqPrQlOGOgamzx9XkzOEO2U2TVmn0xPo+bKm3JixJ6XX81VpT3+SiTky1lQ== 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=1740428828; 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=8PeaQyGTimWYxlcmAEee5c/n8h9wOQZsIJGkyfxJB6A=; b=BwrwaHji5B9QXa6IIyLL9KAzVQ6AXmpoQp8QmmfvuVTCUxrO7jYARvoLCCCHEGdUqGIEea gaw2gX7hMk/8RuYXvbVpCj5qwxD582eAxRVL7hfaDxhFNaKA7P8vC4DpGqH7lVwdLahWaE 1rYxTpFGWsaZSmDCISdW9mFYDdCfxoK/aelyM8KtZE+dEbAEpNDpC3N5Kh6FFSKiY/Kie5 TiP8glUbT3vRGcn3nxMvIIn7f6TTjsOVTLuPill1syHLM7VAMNnE3Cmc1InF9HsJ3mErB/ 3G54FdhPmC7zTbxj2KejFFE47CUPm2chvoVFRZvL58zw2Hk7aLqdsoDsbTnnxQ== 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 4Z1sj84n8ZzvnG; Mon, 24 Feb 2025 20:27:08 +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 51OKR8JM027201; Mon, 24 Feb 2025 20:27:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKR8G6027198; Mon, 24 Feb 2025 20:27:08 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:08 GMT Message-Id: <202502242027.51OKR8G6027198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 09d83ae036c7 - stable/14 - LinuxKPI: 802.11: adjust the hw_scan channel list List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 09d83ae036c7cd28256fede833fbd33f78afd769 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=09d83ae036c7cd28256fede833fbd33f78afd769 commit 09d83ae036c7cd28256fede833fbd33f78afd769 Author: Bjoern A. Zeeb AuthorDate: 2025-02-12 23:26:24 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:48 +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) (cherry picked from commit c272abc5c6a72881f1252f069d79990201559d1a) --- 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 d0dde529c7a8..02cacc62a4c2 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. @@ -3268,7 +3268,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; @@ -3285,14 +3284,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; @@ -3346,9 +3362,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 */ @@ -3357,6 +3375,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) {