drivers/net/ethernet/qualcomm/emac/emac-ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/qualcomm/emac/emac-ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/qualcomm/emac/emac-ethtool.c- Extension
.c- Size
- 6523 bytes
- Lines
- 288
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ethtool.hlinux/phy.hemac.h
Detected Declarations
function emac_get_msglevelfunction emac_set_msglevelfunction emac_get_sset_countfunction emac_get_stringsfunction emac_get_ethtool_statsfunction emac_nway_resetfunction emac_get_ringparamfunction emac_set_ringparamfunction emac_get_pauseparamfunction emac_set_pauseparamfunction emac_get_regsfunction emac_get_regs_lenfunction emac_set_priv_flagsfunction emac_get_priv_flagsfunction emac_set_ethtool_ops
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
*/
#include <linux/ethtool.h>
#include <linux/phy.h>
#include "emac.h"
static const char * const emac_ethtool_stat_strings[] = {
"rx_ok",
"rx_bcast",
"rx_mcast",
"rx_pause",
"rx_ctrl",
"rx_fcs_err",
"rx_len_err",
"rx_byte_cnt",
"rx_runt",
"rx_frag",
"rx_sz_64",
"rx_sz_65_127",
"rx_sz_128_255",
"rx_sz_256_511",
"rx_sz_512_1023",
"rx_sz_1024_1518",
"rx_sz_1519_max",
"rx_sz_ov",
"rx_rxf_ov",
"rx_align_err",
"rx_bcast_byte_cnt",
"rx_mcast_byte_cnt",
"rx_err_addr",
"rx_crc_align",
"rx_jabbers",
"tx_ok",
"tx_bcast",
"tx_mcast",
"tx_pause",
"tx_exc_defer",
"tx_ctrl",
"tx_defer",
"tx_byte_cnt",
"tx_sz_64",
"tx_sz_65_127",
"tx_sz_128_255",
"tx_sz_256_511",
"tx_sz_512_1023",
"tx_sz_1024_1518",
"tx_sz_1519_max",
"tx_1_col",
"tx_2_col",
"tx_late_col",
"tx_abort_col",
"tx_underrun",
"tx_rd_eop",
"tx_len_err",
"tx_trunc",
"tx_bcast_byte",
"tx_mcast_byte",
"tx_col",
};
#define EMAC_STATS_LEN ARRAY_SIZE(emac_ethtool_stat_strings)
static u32 emac_get_msglevel(struct net_device *netdev)
{
struct emac_adapter *adpt = netdev_priv(netdev);
return adpt->msg_enable;
}
static void emac_set_msglevel(struct net_device *netdev, u32 data)
{
struct emac_adapter *adpt = netdev_priv(netdev);
adpt->msg_enable = data;
}
static int emac_get_sset_count(struct net_device *netdev, int sset)
{
switch (sset) {
case ETH_SS_PRIV_FLAGS:
return 1;
case ETH_SS_STATS:
return EMAC_STATS_LEN;
default:
return -EOPNOTSUPP;
}
}
Annotation
- Immediate include surface: `linux/ethtool.h`, `linux/phy.h`, `emac.h`.
- Detected declarations: `function emac_get_msglevel`, `function emac_set_msglevel`, `function emac_get_sset_count`, `function emac_get_strings`, `function emac_get_ethtool_stats`, `function emac_nway_reset`, `function emac_get_ringparam`, `function emac_set_ringparam`, `function emac_get_pauseparam`, `function emac_set_pauseparam`.
- 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.