From nobody Wed Feb 26 23:46:14 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 4Z3B1y3mmTz5pBlx; Wed, 26 Feb 2025 23:46:14 +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 4Z3B1y21gpz3pVY; Wed, 26 Feb 2025 23:46:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740613574; 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=peTZM0aYmAsQIATuf0TtdTCIIaKB1k4s/MS9XveB7o4=; b=v9Vv58NKCtaglQ0llc4mgMilmhAUuqVTDIsSV6InutY1liLD7y+FrmIDFM2LuGu7sVzJik 3rFtvusIz2Xze/RiSxxLGZ0x6jcV6plvUPMYaFPHizVtb+btrtSa2Vo9HKa423aR7/JKrs aaxZdGUQf6cgNNrCez3efm5GgtsR/TTOlftvly/vNw04q4Fw0zcpTc8gHmd59J1PQHt7/B yvAcqfXATWl9uanRIii+3mCjbS9iPFoqoPhsZtKs31w1SvUkh2gWvwY1pmPRtFGCAfrcYW ShmFR4Q+DPB6Rcaed59/jiDfHwLYQvgTBHiwoeNV8ZlSmUDgWRvJ5V1lJMZ18Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740613574; a=rsa-sha256; cv=none; b=o9VQMo/U5zdvkEAN2q67FjFcd6jYq9bwBwMQuAMMvxczAnX+8Qw8m5M6JNKgLXmfgwidLs jrd7LoJ1Eh9sk44lI5QT+uuysJCzu3P72GJWZFUwbgd2GDGbED7LS2Eoa9GACt2IRro721 ZewHzbSCtFXMtQoHrdIPo5aWAua8IoGAb0FSx7lnNUpiDwFGyCbqyVu9c/NhQQq0WJy3EC 9PmkkA/pM4xRWdfXM3BwMIB4APO2+Lax/3o8kYgLdPoJ3x4C65gRX9C4SgxUFQr8qAg6ng zqMKbJVpsSpWnLVpfpf5wzQZwLSvpgd5lotpwqMj1JKtpxAGz/gdLWCAYbYTbQ== 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=1740613574; 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=peTZM0aYmAsQIATuf0TtdTCIIaKB1k4s/MS9XveB7o4=; b=ccGzCKVAIkIpyMewUidXy+kw1PHm0L5EOMTZDZFg+9aGsHwAiMq1ryk/bMjrXkvfor32uQ 3lgZTY7KQwFlcf2R95NUt7zCsq3eYGC3fXzGjcqHR+t6uAA3nQJ2zypK3EXvjq4Y2SqEXL tRnzO6ZrTYPrry47J0qr77sEdmoKT+Vx7TxsBF/wAGQxK+FtZFlUpkcVKXD8swbPWbIz1/ G1XXhhV6mYqfIk/8HQ15aQjTZ8L+w7DZ6ku1SrHI9FZu9+8tCLUyannFwILfZMOSVH8AMP fHGhqaOPkNkwC74EhVOwPm9taAeq+vltDdji43D41Oj80Yk8FJvBW0BCoMeu8Q== 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 4Z3B1y1QG1z314; Wed, 26 Feb 2025 23:46:14 +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 51QNkEkj086554; Wed, 26 Feb 2025 23:46:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QNkE1e086551; Wed, 26 Feb 2025 23:46:14 GMT (envelope-from git) Date: Wed, 26 Feb 2025 23:46:14 GMT Message-Id: <202502262346.51QNkE1e086551@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: 2cc0f3d2f0b1 - stable/14 - LinuxKPI: 802.11: cleanup chanctx freq/width settings 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: 2cc0f3d2f0b1422b7b317bf01a1d678e5ef77acb Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2cc0f3d2f0b1422b7b317bf01a1d678e5ef77acb commit 2cc0f3d2f0b1422b7b317bf01a1d678e5ef77acb Author: Bjoern A. Zeeb AuthorDate: 2025-02-24 01:42:31 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 23:45:57 +0000 LinuxKPI: 802.11: cleanup chanctx freq/width settings Cleanup chanctx freq1/2 and width settings using the channel from the net80211 node and the net80211 functions to return the center frequencies (already doing the math for us or using pre-computed values). Set the min_def (minimum channel definition) to def (channel definition) for the moment as it seems to be unused by anything but iwl_mvm_chanctx_def() to avoid complications. Sponsored by: The FreeBSD Foundation (cherry picked from commit 90d8e307ff610f20dccffe038353affbad0c374e) --- sys/compat/linuxkpi/common/src/linux_80211.c | 43 +++++++++++++--------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index aece603bb763..01d023f80257 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1732,39 +1732,45 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int (chan->flags & IEEE80211_CHAN_RADAR) ? true : false; chanctx_conf->def.chan = chan; chanctx_conf->def.width = NL80211_CHAN_WIDTH_20_NOHT; - chanctx_conf->def.center_freq1 = chan->center_freq; - chanctx_conf->def.center_freq2 = 0; + chanctx_conf->def.center_freq1 = ieee80211_get_channel_center_freq1(ni->ni_chan); + chanctx_conf->def.center_freq2 = ieee80211_get_channel_center_freq2(ni->ni_chan); IMPROVE("Check vht_cap from band not just chan?"); KASSERT(ni->ni_chan != NULL && ni->ni_chan != IEEE80211_CHAN_ANYC, ("%s:%d: ni %p ni_chan %p\n", __func__, __LINE__, ni, ni->ni_chan)); #ifdef LKPI_80211_HT if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) { - if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) chanctx_conf->def.width = NL80211_CHAN_WIDTH_40; - } else + else chanctx_conf->def.width = NL80211_CHAN_WIDTH_20; } #endif #ifdef LKPI_80211_VHT if (IEEE80211_IS_CHAN_VHT(ni->ni_chan)) { #ifdef __notyet__ - if (IEEE80211_IS_CHAN_VHT80P80(ni->ni_chan)) { + if (IEEE80211_IS_CHAN_VHT80P80(ni->ni_chan)) chanctx_conf->def.width = NL80211_CHAN_WIDTH_80P80; - chanctx_conf->def.center_freq2 = 0; /* XXX */ - } else -#endif - if (IEEE80211_IS_CHAN_VHT160(ni->ni_chan)) + else if (IEEE80211_IS_CHAN_VHT160(ni->ni_chan)) chanctx_conf->def.width = NL80211_CHAN_WIDTH_160; - else if (IEEE80211_IS_CHAN_VHT80(ni->ni_chan)) + else +#endif + if (IEEE80211_IS_CHAN_VHT80(ni->ni_chan)) chanctx_conf->def.width = NL80211_CHAN_WIDTH_80; } #endif /* Responder ... */ - chanctx_conf->min_def.chan = chan; +#if 0 + chanctx_conf->min_def.chan = chanctx_conf->def.chan; chanctx_conf->min_def.width = NL80211_CHAN_WIDTH_20_NOHT; - chanctx_conf->min_def.center_freq1 = chan->center_freq; - chanctx_conf->min_def.center_freq2 = 0; - IMPROVE("currently 20_NOHT min_def only"); +#ifdef LKPI_80211_HT + if (IEEE80211_IS_CHAN_HT(ni->ni_chan) || IEEE80211_IS_CHAN_VHT(ni->ni_chan)) + chanctx_conf->min_def.width = NL80211_CHAN_WIDTH_20; +#endif + chanctx_conf->min_def.center_freq1 = chanctx_conf->def.center_freq1; + chanctx_conf->min_def.center_freq2 = chanctx_conf->def.center_freq2; +#else + chanctx_conf->min_def = chanctx_conf->def; +#endif /* Set bss info (bss_info_changed). */ bss_changed = 0; @@ -1797,15 +1803,6 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int vif->bss_conf.chanreq.oper.width = chanctx_conf->def.width; vif->bss_conf.chanreq.oper.center_freq1 = chanctx_conf->def.center_freq1; -#ifdef LKPI_80211_HT - if (vif->bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_40) { - /* Note: it is 10 not 20. */ - if (IEEE80211_IS_CHAN_HT40U(ni->ni_chan)) - vif->bss_conf.chanreq.oper.center_freq1 += 10; - else if (IEEE80211_IS_CHAN_HT40D(ni->ni_chan)) - vif->bss_conf.chanreq.oper.center_freq1 -= 10; - } -#endif vif->bss_conf.chanreq.oper.center_freq2 = chanctx_conf->def.center_freq2; } else {