wifi: ath12k: introduce ath12k_generic_dbg()

There might be instances where ath12k_dbg() is needed, but access to
struct ath12k_base (ab) is not readily available. To address this, add
support to print the debug message using printk() when ab is not present.

To avoid the need to explicitly pass NULL each time, introduce a new macro
ath12k_generic_dbg() which resolves to ath12k_dbg() with ab set to NULL.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00130-QCAHKSWPL_SILICONZ-1.97421.5 # Nicolas Escande

Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Signed-off-by: Aditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com>
Tested-by: Nicolas Escande <nico.escande@gmail.com>
Link: https://patch.msgid.link/20250204-unlink_link_arvif_from_chanctx-v2-2-764fb5973c1a@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
This commit is contained in:
Aditya Kumar Singh 2025-02-04 22:35:08 +05:30 committed by Jeff Johnson
parent cc5faf08aa
commit 80f816d07b
2 changed files with 7 additions and 1 deletions

View File

@ -63,7 +63,10 @@ void __ath12k_dbg(struct ath12k_base *ab, enum ath12k_debug_mask mask,
vaf.fmt = fmt;
vaf.va = &args;
dev_printk(KERN_DEBUG, ab->dev, "%pV", &vaf);
if (likely(ab))
dev_printk(KERN_DEBUG, ab->dev, "%pV", &vaf);
else
printk(KERN_DEBUG "ath12k: %pV", &vaf);
/* TODO: trace log */

View File

@ -69,4 +69,7 @@ do { \
__ath12k_dbg(ab, mask, fmt, ##__VA_ARGS__); \
} while (0)
#define ath12k_generic_dbg(dbg_mask, fmt, ...) \
ath12k_dbg(NULL, dbg_mask, fmt, ##__VA_ARGS__)
#endif /* _ATH12K_DEBUG_H_ */