From nobody Wed Nov 29 16:38:16 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 4SgQ491fG4z52wTP; Wed, 29 Nov 2023 16:38: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SgQ4910Dzz3Hs1; Wed, 29 Nov 2023 16:38:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701275897; 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=X5hotxyvubgyeXFwS9SXgBWwRTVE1jS+tfX/7e7Fij4=; b=TLUOzkVpapVSD9x/7KEF5EEKPVQOSy72V4MGimg6dB9ptgQGhf4+koDSyya+4rktyqgxTw knesiu3m8K4vcGCPORhR1Je54aNxMpGZgHLa+OqUZ9e9O4WdfudygB6f57521mLPUQEcrm K4xK61Y/rO/ToW9slL0sHUt/lGNy+a//OhCogMm/2nAC8L2/5LDVp+PZ4QS1MyA3s6Z5HX U25layNcWRiBA5kN0OA592vVnWmmtUPJPqMyUIO61EkqaLASh30RvPkv9C9yt6jzKPOLzi LtWTmVxjWfkizMNBjQPqMSYjYii3Hr5b/q4NqWXnvNFCYBXok8PgMTrDD5Sn7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701275897; 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=X5hotxyvubgyeXFwS9SXgBWwRTVE1jS+tfX/7e7Fij4=; b=AZaXTBCkHf6dT06prdzwp87PU1iZF7a9hxWrGE8S6xHqo4Orh2RrPkuknYqDgssd/yKFaq OQCqWXKffhcTUrHqJ2Wa1lxa2t3XRLcb5BTfygbUltdakzTDY7tNrcx5C5xKVOpo++lyJz GT5psTup/lR1NjH2NRV1YX2PEznyL3qmdALumG4HhSGWRff5QkDNkCJ/2AioMbhHGL5KnY 16mW/1BSpApSK9tgzLIv0a7S2GW0Zg8hLGOPXBu+bS4c6uaITLacAzvP4FCrJ1I/mPdhQ2 rJ+uut8vqx+v7+u1Csw27CMOKnfcO1pksdR43ciqpFLm5G6dJdDpZOM0h8ncNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701275897; a=rsa-sha256; cv=none; b=ZfZs/Ff7IjBOpUHcPCwk7HIr3HVek1FRa2uisyB6TaV0tWEp4sncnlv2APXPwkBo7vKMSN R+PhnWFh2jwwAwcWBSnjbeZlPt1HUpeefCF5bfAtstrQe5yJrdoSbSuwmb0CWyhTScrYe1 0A+Jvayua48neRGxnvGKqgYGfvyyVEl612llQneg7eWRYeEXzJLy3mzqghtnH7XeY1whJT 2ukvg+QZ3mWG/FCWE9VHgVJV+zTZBHnytpljUxIspPNa6QWpgECzA3y9ZGPkbphg+OKrzU NGgWBfxuWKXVDH/oQXCyGewuuGlItg+IaiFJHPo9/t26hUDz83iHFwrDGVd+cQ== 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 4SgQ4906G6z1CZy; Wed, 29 Nov 2023 16:38:17 +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 3ATGcGEH045411; Wed, 29 Nov 2023 16:38:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3ATGcGKF045408; Wed, 29 Nov 2023 16:38:16 GMT (envelope-from git) Date: Wed, 29 Nov 2023 16:38:16 GMT Message-Id: <202311291638.3ATGcGKF045408@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: 9ceccf808c85 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 9ceccf808c85808252cf166d2d334f297551a85e Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9ceccf808c85808252cf166d2d334f297551a85e commit 9ceccf808c85808252cf166d2d334f297551a85e Author: Bjoern A. Zeeb AuthorDate: 2023-09-14 17:57:53 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-11-29 16:36:06 +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. 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 1931a8528ed5..d0f718ae0dc7 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++) {