drivers/net/wireless/ath/ath12k/debug.c

Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath12k/debug.c

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/ath/ath12k/debug.c
Extension
.c
Size
2270 bytes
Lines
111
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

// SPDX-License-Identifier: BSD-3-Clause-Clear
/*
 * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
 * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
 *
 */

#include <linux/vmalloc.h>
#include "core.h"
#include "debug.h"

void ath12k_info(struct ath12k_base *ab, const char *fmt, ...)
{
	struct va_format vaf = {
		.fmt = fmt,
	};
	va_list args;

	va_start(args, fmt);
	vaf.va = &args;
	dev_info(ab->dev, "%pV", &vaf);
	/* TODO: Trace the log */
	va_end(args);
}
EXPORT_SYMBOL(ath12k_info);

void ath12k_err(struct ath12k_base *ab, const char *fmt, ...)
{
	struct va_format vaf = {
		.fmt = fmt,
	};
	va_list args;

	va_start(args, fmt);
	vaf.va = &args;
	dev_err(ab->dev, "%pV", &vaf);
	/* TODO: Trace the log */
	va_end(args);
}
EXPORT_SYMBOL(ath12k_err);

void __ath12k_warn(struct device *dev, const char *fmt, ...)
{
	struct va_format vaf = {
		.fmt = fmt,
	};
	va_list args;

	va_start(args, fmt);
	vaf.va = &args;
	dev_warn_ratelimited(dev, "%pV", &vaf);
	/* TODO: Trace the log */
	va_end(args);
}
EXPORT_SYMBOL(__ath12k_warn);

#ifdef CONFIG_ATH12K_DEBUG

void __ath12k_dbg(struct ath12k_base *ab, enum ath12k_debug_mask mask,
		  const char *fmt, ...)
{
	struct va_format vaf;
	va_list args;

	va_start(args, fmt);

	vaf.fmt = fmt;
	vaf.va = &args;

	if (likely(ab))
		dev_printk(KERN_DEBUG, ab->dev, "%pV", &vaf);
	else
		printk(KERN_DEBUG "ath12k: %pV", &vaf);

	/* TODO: trace log */

	va_end(args);
}
EXPORT_SYMBOL(__ath12k_dbg);

void ath12k_dbg_dump(struct ath12k_base *ab,
		     enum ath12k_debug_mask mask,
		     const char *msg, const char *prefix,
		     const void *buf, size_t len)
{
	char linebuf[256];
	size_t linebuflen;
	const void *ptr;

	if (ath12k_debug_mask & mask) {

Annotation

Implementation Notes