git: 60e471befc83 - stable/13 - LinuxKPI: 802.11: hide txq debugging behind checks

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Wed, 29 Nov 2023 16:38:44 UTC
The branch stable/13 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=60e471befc83a5e2203b1d45326a5d9ac7ff91d5

commit 60e471befc83a5e2203b1d45326a5d9ac7ff91d5
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2023-10-04 20:30:00 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2023-11-29 16:36:10 +0000

    LinuxKPI: 802.11: hide txq debugging behind checks
    
    Two txq debug messages were left unconditionally.  Hide them behind
    ifdef/if() condition checks for selective debugging only.
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 0d2cb6a6ecde3b271ede59d77801cb43a8804688)
---
 sys/compat/linuxkpi/common/src/linux_80211.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index 0a673a313c1e..b3aec1e712bd 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -4911,15 +4911,18 @@ linuxkpi_ieee80211_stop_queue(struct ieee80211_hw *hw, int qnum)
 		for (ac = 0; ac < ac_count; ac++) {
 			IMPROVE_TXQ("LOCKING");
 			if (qnum == vif->hw_queue[ac]) {
+#ifdef LINUXKPI_DEBUG_80211
 				/*
 				 * For now log this to better understand
 				 * how this is supposed to work.
 				 */
-				if (lvif->hw_queue_stopped[ac])
+				if (lvif->hw_queue_stopped[ac] &&
+				    (linuxkpi_debug_80211 & D80211_IMPROVE_TXQ) != 0)
 					ic_printf(lhw->ic, "%s:%d: lhw %p hw %p "
 					    "lvif %p vif %p ac %d qnum %d already "
 					    "stopped\n", __func__, __LINE__,
 					    lhw, hw, lvif, vif, ac, qnum);
+#endif
 				lvif->hw_queue_stopped[ac] = true;
 			}
 		}
@@ -4966,15 +4969,18 @@ lkpi_ieee80211_wake_queues(struct ieee80211_hw *hw, int hwq)
 
 				/* XXX-BZ what about software scan? */
 
+#ifdef LINUXKPI_DEBUG_80211
 				/*
 				 * For now log this to better understand
 				 * how this is supposed to work.
 				 */
-				if (!lvif->hw_queue_stopped[ac])
+				if (!lvif->hw_queue_stopped[ac] &&
+				    (linuxkpi_debug_80211 & D80211_IMPROVE_TXQ) != 0)
 					ic_printf(lhw->ic, "%s:%d: lhw %p hw %p "
 					    "lvif %p vif %p ac %d hw_q not stopped\n",
 					    __func__, __LINE__,
 					    lhw, hw, lvif, vif, ac);
+#endif
 				lvif->hw_queue_stopped[ac] = false;
 
 				LKPI_80211_LVIF_LOCK(lvif);