From nobody Mon Feb 24 03:08:16 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 4Z1QfS6ZQLz5pY1w; Mon, 24 Feb 2025 03:08:16 +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 4Z1QfS4z61z47sC; Mon, 24 Feb 2025 03:08:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740366496; 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=BbwPSKS0hp6B9UdBmFdfa6A2QiWfcKhMCf+hzaEQBig=; b=kePAMRmampgoLocsCkM+VUm/G1wxMpeKmp6A9E7XqZE733IIvNS8rQnt2KZODiM62bX/wN CZS88FUPFRDgQMSgRWjkiLs8jt5uG1/qS0PCjiNA8Nv3pRTkZCF17THw7hyeiutf+sOVeA IJGfMK505lLJqHaE2N13eLlp1CV/9iIu0wnn+wgntnc+HuryK8gvJUGy979cN+IC6dvONP qF0LY6qX5NBG+yDzrC4tWT6SNI7Y0PAaiso3K1l/MjleuqLmwMjUqsQrsGFL/Z/j465BAg bSM5j96/MFdnp5oLxPQq3KFgZ1mbaVAHq7odFLnvb891j855wt+BaBwpDgMjGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740366496; a=rsa-sha256; cv=none; b=JnkaTs9a1aE8U50tr2OlLdWJi0b+IgCFidfZSrs6GlMoJJ42axwrIA794TfRv8E3UFFRnA DqIXjzxeIwnNnoovm6Z14YUNhDaPCrNBgR26/iELWKEhD9ugi7zyAJc91ikptdsciDVw2e n90qp3BOb7q09G3c+FlceGJOtmR+4O1mkxyHw5OQL0qS4FOz7hufIWDoBpQiXti3EyJjdE GzQoxH19qm3S4/lJDgEUlVPsBcBxPG14BPPIfR/pviNPvOVfHjyk/ZLy5Nqjrmw8k/EObS qajfHDNpvqFp7iu+ZgGqUVaPGNe6YtRA/F64St6cFJ5/QUFFhYyNGZi6DtA/0A== 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=1740366496; 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=BbwPSKS0hp6B9UdBmFdfa6A2QiWfcKhMCf+hzaEQBig=; b=d64aQbB4KdPOyzFYolIJwYGarLTCGMdHaTSKBwcjVQXR4iHmRo9tDKgA7du6kEZHgowvAT a74YA394I/4NRZYs3qESyraLOBLnzMuLKggEpqQyEaiuklwC6ayTvc1z6lgXvIWKh7iebd mWWbz40qLVcMa0r/1jYSHzIriaXsMkK4if6Jb2qeP8N20JSqmHeMsduHVzG71FY6PzUH53 0M47Z1HlWzpRkau77GQ767M+o2dxmUNjrXtibWirPnfMjyNRrEPLveUFk0bphUDqfa0sqn 1uVnHzB0pEwVvSoBlQohgXw3tjeBCIu+umevNT8tHHDeSnsohGdziBXEUcVYWg== 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 4Z1QfS45rCz70n; Mon, 24 Feb 2025 03:08:16 +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 51O38GUc083270; Mon, 24 Feb 2025 03:08:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51O38GS6083267; Mon, 24 Feb 2025 03:08:16 GMT (envelope-from git) Date: Mon, 24 Feb 2025 03:08:16 GMT Message-Id: <202502240308.51O38GS6083267@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 90d8e307ff61 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 90d8e307ff610f20dccffe038353affbad0c374e Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=90d8e307ff610f20dccffe038353affbad0c374e commit 90d8e307ff610f20dccffe038353affbad0c374e Author: Bjoern A. Zeeb AuthorDate: 2025-02-24 01:42:31 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 01:42:31 +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 MFC after: 3 days --- 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 b53d8eaa7925..6d6d14e06a57 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 {