drivers/net/ethernet/qualcomm/qca_debug.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/qualcomm/qca_debug.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/qualcomm/qca_debug.c- Extension
.c- Size
- 6737 bytes
- Lines
- 289
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/debugfs.hlinux/ethtool.hlinux/seq_file.hlinux/types.hqca_7k.hqca_debug.h
Detected Declarations
function qcaspi_info_showfunction qcaspi_init_device_debugfsfunction qcaspi_remove_device_debugfsfunction qcaspi_init_device_debugfsfunction qcaspi_get_link_ksettingsfunction qcaspi_get_ethtool_statsfunction qcaspi_get_stringsfunction qcaspi_get_sset_countfunction qcaspi_get_regs_lenfunction qcaspi_get_regsfunction qcaspi_get_ringparamfunction qcaspi_set_ringparamfunction qcaspi_set_ethtool_ops
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
/*
* Copyright (c) 2011, 2012, Qualcomm Atheros Communications Inc.
* Copyright (c) 2014, I2SE GmbH
*/
/* This file contains debugging routines for use in the QCA7K driver.
*/
#include <linux/debugfs.h>
#include <linux/ethtool.h>
#include <linux/seq_file.h>
#include <linux/types.h>
#include "qca_7k.h"
#include "qca_debug.h"
#define QCASPI_MAX_REGS 0x20
#define QCASPI_RX_MAX_FRAMES 4
static const u16 qcaspi_spi_regs[] = {
SPI_REG_BFR_SIZE,
SPI_REG_WRBUF_SPC_AVA,
SPI_REG_RDBUF_BYTE_AVA,
SPI_REG_SPI_CONFIG,
SPI_REG_SPI_STATUS,
SPI_REG_INTR_CAUSE,
SPI_REG_INTR_ENABLE,
SPI_REG_RDBUF_WATERMARK,
SPI_REG_WRBUF_WATERMARK,
SPI_REG_SIGNATURE,
SPI_REG_ACTION_CTRL
};
/* The order of these strings must match the order of the fields in
* struct qcaspi_stats
* See qca_spi.h
*/
static const char qcaspi_gstrings_stats[][ETH_GSTRING_LEN] = {
"Triggered resets",
"Device resets",
"Reset timeouts",
"Read errors",
"Write errors",
"Read buffer errors",
"Write buffer errors",
"Out of memory",
"Write buffer misses",
"Transmit ring full",
"SPI errors",
"Write verify errors",
"Buffer available errors",
"Bad signature",
};
#ifdef CONFIG_DEBUG_FS
static int
qcaspi_info_show(struct seq_file *s, void *what)
{
struct qcaspi *qca = s->private;
seq_printf(s, "RX buffer size : %lu\n",
(unsigned long)qca->buffer_size);
seq_puts(s, "TX ring state : ");
if (qca->txr.skb[qca->txr.head] == NULL)
seq_puts(s, "empty");
else if (qca->txr.skb[qca->txr.tail])
seq_puts(s, "full");
else
seq_puts(s, "in use");
seq_puts(s, "\n");
seq_printf(s, "TX ring size : %u\n",
qca->txr.size);
seq_printf(s, "Sync state : %u (",
(unsigned int)qca->sync);
switch (qca->sync) {
case QCASPI_SYNC_UNKNOWN:
seq_puts(s, "QCASPI_SYNC_UNKNOWN");
break;
case QCASPI_SYNC_RESET:
seq_puts(s, "QCASPI_SYNC_RESET");
break;
case QCASPI_SYNC_READY:
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/ethtool.h`, `linux/seq_file.h`, `linux/types.h`, `qca_7k.h`, `qca_debug.h`.
- Detected declarations: `function qcaspi_info_show`, `function qcaspi_init_device_debugfs`, `function qcaspi_remove_device_debugfs`, `function qcaspi_init_device_debugfs`, `function qcaspi_get_link_ksettings`, `function qcaspi_get_ethtool_stats`, `function qcaspi_get_strings`, `function qcaspi_get_sset_count`, `function qcaspi_get_regs_len`, `function qcaspi_get_regs`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.