From nobody Wed Oct 04 15:23:47 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 4S0z435JcTz4w6Wt; Wed, 4 Oct 2023 15:23:47 +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 4S0z434C72z4NFP; Wed, 4 Oct 2023 15:23:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696433027; 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=WJat4+HeVrCMHUFygXH4Zz/mcS2FHQtDBujj8TFzIzc=; b=jxJG/2+P7bVpU2ec+9uB9g9V+qaw+jL+NwJqjLuqqIkC2EUhInzpyaG16OnbzPafhoGyvC qLf0KgxIHiWXKPWiGsTuPKsjylA+1fSEyyW/IWcA5Dt2O46u1wfFi+tOzIkcnTI1svg3ZX yUBRlnKlFrkBRSQldCSYMugOB687/t9sgTuG9o1EVqqD0GwpwYRetZXN36sgbv1DFb1okU cfMSPZ24iNe8Ap/upzWpAmOyzwZyPFUsV+Su9O5dFfYdupYvnj0omYAaPSnRrqz3KqsH2x YbOkTA0kCXwadgN0NB5SiqYYmE8MmrzIfECstbA3x9c40XB5ssW/+U2FReYd2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696433027; a=rsa-sha256; cv=none; b=F29f4raWkiMkzk/MORyV0WUqUmaaJ0+sX8AOjD3h1E0rKmQKa23IAP4LDap9VRuNOIk5DG kzx+zUJw8UnMEFTqRK22Ta9tHxl1zq81mHBBc2Sj6wYi5X4sOSVYVjwYDOnAQNjbCAMu3r ympPw4wgqu3ScddlxCpbSwWpU3BSuF7fwSKCOrUSYRBPAphh4XkqHEua2rsZdsentTjhdY u4+SEWbW80TTtcy51yM/O2ByRqsTF6M8wmbOhv+0QtGMOShg3/xqIwuMSOzVcapXLOqURJ lTgFgOSQ6yaCnQ4DMYM0UuRxkQRCHLhH+NzfdLnXwdNxtgAq8XFTY2p3e0nSDQ== 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=1696433027; 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=WJat4+HeVrCMHUFygXH4Zz/mcS2FHQtDBujj8TFzIzc=; b=oKSxNlWa9Ak/TkTxRvZ0PZJWD/FkWAgex9L83JpHGsDcKg2HA181z+WK7vazRssd8B5SOC yw1i7bZKfoDHZpOMInWUevw2tqtn/OeNChXzABUyf9zl9hJW0osX4Rn7SFrhGppm53kLGz iyi/mnqhnIA5gOQyJJR2OOmqZQVphbob3575nRtbPDXnAh0l1cU/iq9rtjqTf1eYEA2DrL js3BjBIO91QoNsuSQUPJO5B0LkvOlwmEpNaBx/8vEyZbK4FbPyvl/Z5iCL+T2lgMDSHQsU WZCtJoD2peZ3SMszGcHM+9sf2w+ASDqpI+gRRx0zWZ2EPAYcuQdSAfPsTjqcAA== 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 4S0z433Hd6zj7X; Wed, 4 Oct 2023 15:23:47 +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 394FNlJH087073; Wed, 4 Oct 2023 15:23:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 394FNls2087070; Wed, 4 Oct 2023 15:23:47 GMT (envelope-from git) Date: Wed, 4 Oct 2023 15:23:47 GMT Message-Id: <202310041523.394FNls2087070@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: 96655d8a7db4 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 96655d8a7db48f0944aebf07ffdcaa8a23aaa35a Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=96655d8a7db48f0944aebf07ffdcaa8a23aaa35a commit 96655d8a7db48f0944aebf07ffdcaa8a23aaa35a Author: Bjoern A. Zeeb AuthorDate: 2023-09-14 17:57:53 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-10-04 15:19:18 +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 (cherry picked from commit f454a4a10dc027474a85269cb4a3f50bbbf90528) --- 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 4b9cc598740b..cb919bfd3f5b 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -3760,8 +3760,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; @@ -3772,6 +3771,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++) {