From nobody Mon Oct 9 23:16:10 2023 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 4S4FJp3pvDz4wgkB; Mon, 9 Oct 2023 23:16:10 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S4FJp2w3rz3QB4; Mon, 9 Oct 2023 23:16:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696893370; 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=4eK+5lIpCpmr9onBOZRWyYelHP/YdA45TvRqPG9SJjo=; b=EoNYNjqRfPgQjAk++tCl7bKmqOiyAcPOOuFcqhax9lwizncm+n6YOhe68HviVDF+IVVy6q GwL8kLHpdeX13vhZUxqNQPz9EhVlC4LdckhjyvXBody7Uyf5cknd4Zm2vKiTTJh32Hd1ZH xF4d9ZRqA16qGsrE86yHYJDPd1/LBz5drPX2pI5qNfENPDs4ZBf0VGMFk84xBj3ZcKmwOQ CDl4SqdqqeUHW3evSSloHZfT+ooGO+nTh1jEBzWEfnRaDJzj32sEuEwAQ6o+zgvgsrsNRW uOB3uogu7nwWTDxc9p+wuJG3PquCbebtfLi3f6nH/Qzxtoc7XTBPaTBiZX8UJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696893370; a=rsa-sha256; cv=none; b=KOHo/dPkLvw5/HOqRsrUxXyAdzoCupHAbfZg6uhh1G+IAvxAgSYeOygjRG69n153zy3ZeM VRSpZuDZ/8mpSojywL/T++gQSDeM/gpIwt0FqdHOoFwn2GNfZ9fMmPr+QncUkEtdaklUST n8keNJWPSFxPxQHcZVpr3sX1vRzzlanvkPsVeeiJXS8eS0/jBk9EPPz8siPDl1x2K1DSTs 0oq/8yjkmdiT5BUDpwmHe/ynZuM2jo3RNmV7nXNbKMu+PxcbXF9ixnEqVm1pI/dM+cQM1R HnupYUyXqTluBMoPbxBKnggUuCSEeBZTlxeVK9b9xXvM5/m9RL7rMPef90fwTA== 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=1696893370; 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=4eK+5lIpCpmr9onBOZRWyYelHP/YdA45TvRqPG9SJjo=; b=oD55RMLE0GFfbuM7VUSJnZbH7/Kv3kjRkSo9ZYgvu5wfRc04aD3x/mLo9ODs3CSSF0dpzJ FamfVYGmk5bUEWwmbUTK3PwVFRFOpzhKQPnKfKOfeRfkFND107x29/BJu320DM8hyCPkyc VvQ5mCXIDxGxHXHxTemlXD6TD6UKgCbJTa3yqfEmZvd38/WQrsQ4K9/cYW/befiv+qX8z7 nC1m4tPrJYP36BHBGalslQiqkf/d6iHheCLXuHArM5ThloUO1ocOuk5t3gqbeAYot8KwkV NRJcH3PzBq7T2QB9dEtw/ElnNN3amnhkrrjsa3tq1PpnfghJNc3WfNkxSoaVmQ== 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 4S4FJp1XP7z17G; Mon, 9 Oct 2023 23:16:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 399NGAHi071032; Mon, 9 Oct 2023 23:16:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 399NGAC3071029; Mon, 9 Oct 2023 23:16:10 GMT (envelope-from git) Date: Mon, 9 Oct 2023 23:16:10 GMT Message-Id: <202310092316.399NGAC3071029@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: 2f528e6583b4 - releng/14.0 - LinuxKPI: 802.11: fix counting the number of supbands 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 2f528e6583b4c64b0d00df3744af298d6351c937 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2f528e6583b4c64b0d00df3744af298d6351c937 commit 2f528e6583b4c64b0d00df3744af298d6351c937 Author: Bjoern A. Zeeb AuthorDate: 2023-09-14 17:57:53 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-10-09 23:14:52 +0000 LinuxKPI: 802.11: fix counting the number of supbands While the main purpose was to assign an(y) early chandef with the loop, later additions made use of it to also count supbands as well as to initialise max_rates. Due to the main goal we can exit the loop early and not properly count and initialise supbands and max_rates. Move the terminating condition into the loop and make it a continue rather than ending the loop. Fixes: d9945d7821b9b ("improve hw_scan") Sponsored by: The FreeBSD Foundation Approved by: re (gjb) (cherry picked from commit f454a4a10dc027474a85269cb4a3f50bbbf90528) (cherry picked from commit 96655d8a7db48f0944aebf07ffdcaa8a23aaa35a) --- sys/compat/linuxkpi/common/src/linux_80211.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index f5951c95a8df..5e7a3ff91b9f 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -3767,8 +3767,7 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) * in any band so we can scale [(ext) sup rates] IE(s) accordingly. */ lhw->supbands = lhw->max_rates = 0; - for (band = 0; band < NUM_NL80211_BANDS && - hw->conf.chandef.chan == NULL; band++) { + for (band = 0; band < NUM_NL80211_BANDS; band++) { struct ieee80211_supported_band *supband; struct linuxkpi_ieee80211_channel *channels; @@ -3779,6 +3778,10 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) lhw->supbands++; lhw->max_rates = max(lhw->max_rates, supband->n_bitrates); + /* If we have a channel, we need to keep counting supbands. */ + if (hw->conf.chandef.chan != NULL) + continue; + channels = supband->channels; for (i = 0; i < supband->n_channels; i++) {