From nobody Sat Apr 18 01:12:47 2026 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 4fyDJJ3BB0z6ZTNv for ; Sat, 18 Apr 2026 01:12:48 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyDJH6nBrz3nFk for ; Sat, 18 Apr 2026 01:12:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474768; 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=sDqu8Dgs6oqaX+9eiNIDTPpYdnrrh9g9BhFjcmh6lWc=; b=PSOArDX6S+wc4c31yBzzFiKcVE4aL3mTNiwTSu5ROrEzrG/Fj2KNSLTKvNR6Y2EfahI2Fg yemMFtqiDe1FOXTGlbW3bV3hgBPLsODeWQdyZ7Nl18L5aFkodoW5ExrycZwAFEzMSIDSvb oQXf4U1C5nRQ9XV/uyUA8CinldQjL+7ePjTPmEITbOx1x74zZTfCyNm96ePFAR8sspfsSk nx2hIP3NnApmJBfQ6lzTMf5xIqKU3FAK0HADaHvKMZ2OFDc9O/ZNXssd2vKP1mOzlDH00G VOZ2NpqLE6BYMVGyxscjj/BeUWTu/2ezQ/56zmAzZZa49clQg4nL8VpDwxhNFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776474768; a=rsa-sha256; cv=none; b=JSElTzeR4kEnQ5o2XWfu3Ky4xWnxTYSgzGGNp5DULe4yoWXLiZeToicaHagVeU25tKE3cl pEkyj259T62Z1HuBrXL/NbMlNNnTAG78iFnw54ozgYbT3sjnnW5A7KflOfhikwFBE3mQoE ORSwLbPBecaod4cOXHbSgF1PFKbzKqsu6q5weDIzVVRZiCFLXsYJVoaS9bbGZNff4G0xJx SKDlgaW1Nm/R8CU25yulQPwCPO3SD3t8jedzmu9SgQ92FZ9iDNmmYC2MieZI0EM7rWmOOj FAJREeFJwsIYSJzj0763rPvKGFO5ViZwYV3AROz3cK40ONzpUM+1NYl9YORbmA== 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=1776474768; 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=sDqu8Dgs6oqaX+9eiNIDTPpYdnrrh9g9BhFjcmh6lWc=; b=cmAjNFiGczHuPCZjoYKPE5Z/8u2XkcCa+FctPtB8+4P4vE1L8m0eRcONxIAzdV2S6oo9mg B1eIcvFSKzuSANRS8jPzhJDuFRAAjlasHxCas/6UYU7DXhPaFJTPKeKvzj9X6fW4YY6NHJ LvhQjPsOdHpGF90ZYCnOnsvwIUyKMwpU9Y2NweibQa2C/cb+bgpYNkH/vcfcWTzirCR4L+ wCtgxZKi0Ams+GA2DUqUSNq5XxdsIW9FJ3sZ+txK84jrl639DgM70IaPuAj2Xt3FncMX15 mp7JYO/Z21d9EjnK6+IZIHJVfJFiCuYKNfdKVd7KnCN9Vi6r6rqWXu7XxsTd6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyDJH6GrNz32T for ; Sat, 18 Apr 2026 01:12:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4572d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 01:12:47 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 72b9dda511b6 - main - LinuxKPI: 802.11: add chandef tracing 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: 72b9dda511b6944068fb18c2f2e059bca48d9edd Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 01:12:47 +0000 Message-Id: <69e2da8f.4572d.cac6387@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=72b9dda511b6944068fb18c2f2e059bca48d9edd commit 72b9dda511b6944068fb18c2f2e059bca48d9edd Author: Bjoern A. Zeeb AuthorDate: 2026-04-03 19:59:02 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 01:12:09 +0000 LinuxKPI: 802.11: add chandef tracing Add chandef tracing so we can follow what is set and unset in the chanctx emulation for drivers still needing this. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 79 ++++++++++++++++++++++++++-- sys/compat/linuxkpi/common/src/linux_80211.h | 1 + 2 files changed, 77 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index c2f2adfc7053..e1a3daf98cb2 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -2219,7 +2219,8 @@ lkpi_80211_flush_tx(struct lkpi_hw *lhw, struct lkpi_sta *lsta) } static void -lkpi_init_chandef(struct cfg80211_chan_def *chandef, +lkpi_init_chandef(struct ieee80211com *ic __unused, + struct cfg80211_chan_def *chandef, struct linuxkpi_ieee80211_channel *chan, struct ieee80211_channel *c, bool can_ht) { @@ -2248,6 +2249,17 @@ lkpi_init_chandef(struct cfg80211_chan_def *chandef, chandef->width = NL80211_CHAN_WIDTH_80; } #endif + +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_CHANDEF) != 0) + ic_printf(ic, "%s:%d: chandef %p { chan %p { %u }, " + "width %d cfreq1 %u cfreq2 %u punctured %u }\n", + __func__, __LINE__, chandef, + chandef->chan, chandef->chan->center_freq, + chandef->width, + chandef->center_freq1, chandef->center_freq2, + chandef->punctured); +#endif } static uint32_t @@ -2587,11 +2599,18 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int #else can_ht = false; #endif - lkpi_init_chandef(&chandef, chan, ni->ni_chan, can_ht); + lkpi_init_chandef(vap->iv_ic, &chandef, chan, ni->ni_chan, can_ht); hw->conf.radar_enabled = ((chan->flags & IEEE80211_CHAN_RADAR) != 0) ? true : false; hw->conf.chandef = chandef; vif->bss_conf.chanreq.oper = hw->conf.chandef; +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_CHANDEF) != 0) + ic_printf(vap->iv_ic, "%s:%d: hw->conf.chandef %p = chandef %p = " + "vif->bss_conf.chanreq.oper %p\n", __func__, __LINE__, + &hw->conf.chandef, &chandef, &vif->bss_conf.chanreq.oper); +#endif + changed = lkpi_init_chanctx_conf(hw, &chandef, chanctx_conf); /* Responder ... */ @@ -5205,6 +5224,11 @@ lkpi_ic_set_channel(struct ieee80211com *ic) /* We always set the chandef to no-HT for scanning. */ cfg80211_chandef_create(&lhw->scan_chandef, chan, NL80211_CHAN_NO_HT); +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_CHANDEF) != 0) + ic_printf(ic, "%s:%d: initialized lhw->scan_chandef\n", + __func__, __LINE__); +#endif /* * This works for as long as we do not do BGSCANs; otherwise @@ -5232,7 +5256,7 @@ lkpi_ic_set_channel(struct ieee80211com *ic) }; struct cfg80211_chan_def chandef; - lkpi_init_chandef(&chandef, chan, c, false); + lkpi_init_chandef(ic, &chandef, chan, c, false); ieee80211_iter_chan_contexts_mtx(hw, lkpi_ic_set_channel_chanctx_iterf, &chanctx_iter_arg); @@ -5252,6 +5276,11 @@ lkpi_ic_set_channel(struct ieee80211com *ic) lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_CHANDEF) != 0) + ic_printf(ic, "%s:%d: using on stack chandef\n", + __func__, __LINE__); +#endif chanctx_conf = lkpi_get_chanctx_conf(hw, vif); changed = lkpi_init_chanctx_conf(hw, &chandef, chanctx_conf); IMPROVE("update HT, VHT, bw, ..."); @@ -5264,6 +5293,12 @@ lkpi_ic_set_channel(struct ieee80211com *ic) */ IMPROVE("update HT, VHT, bw, ..."); +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_CHANDEF) != 0) + ic_printf(ic, "%s:%d: using on stack chandef\n", + __func__, __LINE__); +#endif + chanctx_conf = chanctx_iter_arg.chanctx_conf; changed = lkpi_init_chanctx_conf(hw, &chandef, chanctx_conf); lkpi_80211_mo_change_chanctx(hw, chanctx_conf, changed); @@ -7073,6 +7108,12 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) #endif NL80211_CHAN_NO_HT); lhw->dflt_chandef = hw->conf.chandef; +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_CHANDEF) != 0) + ic_printf(ic, "%s:%d: initialized " + "hw->conf.chandef and dflt_chandef to %p\n", + __func__, __LINE__, &lhw->dflt_chandef); +#endif break; } } @@ -9334,11 +9375,26 @@ lkpi_80211_update_chandef(struct ieee80211_hw *hw, * scan_chandef should have a channel set. */ if (lhw->scan_chandef.chan != NULL) { +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_CHANDEF) != 0) + ic_printf(lhw->ic, "%s:%d: using scan_chandef %p\n", + __func__, __LINE__, &lhw->scan_chandef); +#endif cd = &lhw->scan_chandef; } else { +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_CHANDEF) != 0) + ic_printf(lhw->ic, "%s:%d: using dflt_chandef %p\n", + __func__, __LINE__, &lhw->dflt_chandef); +#endif cd = &lhw->dflt_chandef; } } else { +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_CHANDEF) != 0) + ic_printf(lhw->ic, "%s:%d: using chanctx %p chandef %p\n", + __func__, __LINE__, new, &new->def); +#endif cd = &new->def; } @@ -9351,6 +9407,23 @@ lkpi_80211_update_chandef(struct ieee80211_hw *hw, } IMPROVE("IEEE80211_CONF_CHANGE_PS, IEEE80211_CONF_CHANGE_POWER"); +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_CHANDEF) != 0) + ic_printf(lhw->ic, "%s:%d: chanctx %p { %u } cd %p { %u } " + "hw->conf.chandef %p { %u %d %u %u %u }, " + "changed %#04x same %d\n", + __func__, __LINE__, + new, (new != NULL && new->def.chan != NULL) ? + new->def.chan->center_freq : 0, + cd, cd->chan->center_freq, + &hw->conf.chandef, hw->conf.chandef.chan->center_freq, + hw->conf.chandef.width, + hw->conf.chandef.center_freq1, + hw->conf.chandef.center_freq2, + hw->conf.chandef.punctured, + changed, same); +#endif + if (changed == 0) return (0); diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index 235597ea7a94..569c4f12f6d6 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -57,6 +57,7 @@ #define D80211_IMPROVE 0x00000002 #endif #define D80211_IMPROVE_TXQ 0x00000004 +#define D80211_CHANDEF 0x00000008 #define D80211_TRACE 0x00000010 #define D80211_TRACEOK 0x00000020 #define D80211_SCAN 0x00000040