From nobody Wed Apr 22 21:08: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 4g1BfS1nGSz6bL24 for ; Wed, 22 Apr 2026 21:08: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 4g1BfR5nwRz3lFF for ; Wed, 22 Apr 2026 21:08:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776892127; 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=Zfxt1xmGBrDI/q2t9YIVS3scL8LVlsZIcarf+22fF58=; b=UmnX7qEJP8j44OgoxogbwSvurosdZXQEXtJ25NM5ysK9Jyc5TktuPO7ckkROCAzzxrzE6k FgJKwRvp+Aqopa7cqlSk7VRrbn1P4O6d8q/XTyzSlKBOL3QDkiyfunX7JrCvArs/k9s769 DlATy29UKOwsc8bveK8ikPcadlDKMtPMP7QFC2xzCcWpmBgO9E4M5/6xoMMgJPdwV4vQzV 1hefKnK27meI57QTO+vBNbLoky7WPgUOoUzyAPPPX978I1V+lqkF7dYqhABE3LzojG8zdO 4Jn1Pcj6aJCXGUs6g07dHg02FzH3pvYKQGkzd69GnzlD2jZPRwBbvJ4iuQ4RJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776892127; a=rsa-sha256; cv=none; b=JFk42A1s/w0XIvikmZsV1x3TekLQfHuKzis8j4h82VZXP27zh6w4etpmYen1vEKHE8WPFZ /ot9VXeDrIDqraE60OgAzxL2adjxJzoHPNdlN9ozdissOfmtGepA2Idktj7vUOL6q1ouI1 SDrQ3n0hY9Ts+ZF2A2UAwcbr/HAIgjUqDunhWqWCoz74U/dQf4g0vE+nND2mFGikYorZ3M V8Gcqqczc7pYYkLkwouHUB+nQurHQSUG+vvruQrHfxY+0jvTsaU23mJMxxNoWasSlJG4/3 8DTPYGdxA626r5DjKQGDJDN57VR0sgpl6HRAWKk2qvTaobIJK9NXdKMeMMQYmA== 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=1776892127; 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=Zfxt1xmGBrDI/q2t9YIVS3scL8LVlsZIcarf+22fF58=; b=JoULG5Vvi/Wv6ZAmDaw57cehuFqk3c7MAEaXTefrujTbtJ3IYZXrS9B0pYi436P61RxUbg e0EMbkeHTA4lg1LjjnfOaZyFMN10fnyZ8uX6FoNTNJ0U8FjiLah2fb8CCir5ycjMitf0+I bHmi9iAjq5/13d7uAw/d0Oc77F32IQGPe6eFcqfXlcNOjpJu04etkIkc5iqk707bjNc+Mm GpTXjW6uU8usyt92y3B+xbVttaZWaSgKE++uHem+L4EL6MYF6uHoitC0nvDDVyyLe6Y9tM qobGM0LerkpD16a33I+X0YwtDk9eCxJktBqiEe3Na4cV407lDTNDfov//Yb86Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g1BfR5D2Vzmyc for ; Wed, 22 Apr 2026 21:08:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2767c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 22 Apr 2026 21:08:47 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 222fee361c66 - stable/15 - 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/stable/15 X-Git-Reftype: branch X-Git-Commit: 222fee361c66b140e0a2d09a8e43eabd05389b29 Auto-Submitted: auto-generated Date: Wed, 22 Apr 2026 21:08:47 +0000 Message-Id: <69e938df.2767c.84dba55@gitrepo.freebsd.org> The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=222fee361c66b140e0a2d09a8e43eabd05389b29 commit 222fee361c66b140e0a2d09a8e43eabd05389b29 Author: Bjoern A. Zeeb AuthorDate: 2026-04-03 19:59:02 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-22 20:57:06 +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 (cherry picked from commit 72b9dda511b6944068fb18c2f2e059bca48d9edd) --- 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