drivers/net/wireless/mediatek/mt76/mt7925/debugfs.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/mediatek/mt76/mt7925/debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/mediatek/mt76/mt7925/debugfs.c- Extension
.c- Size
- 8256 bytes
- Lines
- 318
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
mt7925.hmcu.h
Detected Declarations
function mt7925_reg_setfunction mt7925_reg_getfunction mt7925_fw_debug_setfunction mt7925_fw_debug_getfunction mt7925_seq_puts_arrayfunction mt7925_eht_txpwrfunction mt7925_txpwrfunction mt7925_pm_setfunction mt7925_pm_getfunction mt7925_deep_sleep_setfunction mt7925_deep_sleep_getfunction mt7925_chip_resetfunction mt7925_init_debugfs
Annotated Snippet
// SPDX-License-Identifier: BSD-3-Clause-Clear
/* Copyright (C) 2023 MediaTek Inc. */
#include "mt7925.h"
#include "mcu.h"
static int
mt7925_reg_set(void *data, u64 val)
{
struct mt792x_dev *dev = data;
u32 regval = val;
mt792x_mutex_acquire(dev);
mt7925_mcu_regval(dev, dev->mt76.debugfs_reg, ®val, true);
mt792x_mutex_release(dev);
return 0;
}
static int
mt7925_reg_get(void *data, u64 *val)
{
struct mt792x_dev *dev = data;
u32 regval;
int ret;
mt792x_mutex_acquire(dev);
ret = mt7925_mcu_regval(dev, dev->mt76.debugfs_reg, ®val, false);
mt792x_mutex_release(dev);
if (!ret)
*val = regval;
return 0;
}
DEFINE_DEBUGFS_ATTRIBUTE(fops_regval, mt7925_reg_get, mt7925_reg_set,
"0x%08llx\n");
static int
mt7925_fw_debug_set(void *data, u64 val)
{
struct mt792x_dev *dev = data;
mt792x_mutex_acquire(dev);
dev->fw_debug = (u8)val;
mt7925_mcu_fw_log_2_host(dev, dev->fw_debug);
mt792x_mutex_release(dev);
return 0;
}
static int
mt7925_fw_debug_get(void *data, u64 *val)
{
struct mt792x_dev *dev = data;
*val = dev->fw_debug;
return 0;
}
DEFINE_DEBUGFS_ATTRIBUTE(fops_fw_debug, mt7925_fw_debug_get,
mt7925_fw_debug_set, "%lld\n");
DEFINE_SHOW_ATTRIBUTE(mt792x_tx_stats);
static void
mt7925_seq_puts_array(struct seq_file *file, const char *str,
s8 val[][2], int len, u8 band_idx)
{
int i;
seq_printf(file, "%-22s:", str);
for (i = 0; i < len; i++)
if (val[i][band_idx] == 127)
seq_printf(file, " %6s", "N.A");
else
seq_printf(file, " %6d", val[i][band_idx]);
seq_puts(file, "\n");
}
#define mt7925_print_txpwr_entry(prefix, rate, idx) \
({ \
mt7925_seq_puts_array(s, #prefix " (tmac)", \
txpwr->rate, \
ARRAY_SIZE(txpwr->rate), \
idx); \
})
Annotation
- Immediate include surface: `mt7925.h`, `mcu.h`.
- Detected declarations: `function mt7925_reg_set`, `function mt7925_reg_get`, `function mt7925_fw_debug_set`, `function mt7925_fw_debug_get`, `function mt7925_seq_puts_array`, `function mt7925_eht_txpwr`, `function mt7925_txpwr`, `function mt7925_pm_set`, `function mt7925_pm_get`, `function mt7925_deep_sleep_set`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.