git: 5b9404565fef - stable/14 - LinuxKPI: 802.11: hide txq debugging behind checks

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Fri, 06 Oct 2023 14:25:16 UTC
The branch stable/14 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=5b9404565fef6cf4f01210343c8074b9407cb268

commit 5b9404565fef6cf4f01210343c8074b9407cb268
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2023-10-04 20:30:00 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2023-10-06 12:47:40 +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 9f5f5bef7f27..4a296e2f0fad 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);