drivers/net/ethernet/apm/xgene-v2/ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/apm/xgene-v2/ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/apm/xgene-v2/ethtool.c- Extension
.c- Size
- 4881 bytes
- Lines
- 176
- 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
main.h
Detected Declarations
function Copyrightfunction xge_mac_get_extd_statsfunction xge_get_drvinfofunction xge_get_stringsfunction xge_get_sset_countfunction xge_get_ethtool_statsfunction xge_get_link_ksettingsfunction xge_set_link_ksettingsfunction xge_set_ethtool_ops
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Applied Micro X-Gene SoC Ethernet v2 Driver
*
* Copyright (c) 2017, Applied Micro Circuits Corporation
* Author(s): Iyappan Subramanian <isubramanian@apm.com>
* Keyur Chudgar <kchudgar@apm.com>
*/
#include "main.h"
#define XGE_STAT(m) { #m, offsetof(struct xge_pdata, stats.m) }
#define XGE_EXTD_STAT(m, n) \
{ \
#m, \
n, \
0 \
}
static const struct xge_gstrings_stats gstrings_stats[] = {
XGE_STAT(rx_packets),
XGE_STAT(tx_packets),
XGE_STAT(rx_bytes),
XGE_STAT(tx_bytes),
XGE_STAT(rx_errors)
};
static struct xge_gstrings_extd_stats gstrings_extd_stats[] = {
XGE_EXTD_STAT(tx_rx_64b_frame_cntr, TR64),
XGE_EXTD_STAT(tx_rx_127b_frame_cntr, TR127),
XGE_EXTD_STAT(tx_rx_255b_frame_cntr, TR255),
XGE_EXTD_STAT(tx_rx_511b_frame_cntr, TR511),
XGE_EXTD_STAT(tx_rx_1023b_frame_cntr, TR1K),
XGE_EXTD_STAT(tx_rx_1518b_frame_cntr, TRMAX),
XGE_EXTD_STAT(tx_rx_1522b_frame_cntr, TRMGV),
XGE_EXTD_STAT(rx_fcs_error_cntr, RFCS),
XGE_EXTD_STAT(rx_multicast_pkt_cntr, RMCA),
XGE_EXTD_STAT(rx_broadcast_pkt_cntr, RBCA),
XGE_EXTD_STAT(rx_ctrl_frame_pkt_cntr, RXCF),
XGE_EXTD_STAT(rx_pause_frame_pkt_cntr, RXPF),
XGE_EXTD_STAT(rx_unk_opcode_cntr, RXUO),
XGE_EXTD_STAT(rx_align_err_cntr, RALN),
XGE_EXTD_STAT(rx_frame_len_err_cntr, RFLR),
XGE_EXTD_STAT(rx_code_err_cntr, RCDE),
XGE_EXTD_STAT(rx_carrier_sense_err_cntr, RCSE),
XGE_EXTD_STAT(rx_undersize_pkt_cntr, RUND),
XGE_EXTD_STAT(rx_oversize_pkt_cntr, ROVR),
XGE_EXTD_STAT(rx_fragments_cntr, RFRG),
XGE_EXTD_STAT(rx_jabber_cntr, RJBR),
XGE_EXTD_STAT(rx_dropped_pkt_cntr, RDRP),
XGE_EXTD_STAT(tx_multicast_pkt_cntr, TMCA),
XGE_EXTD_STAT(tx_broadcast_pkt_cntr, TBCA),
XGE_EXTD_STAT(tx_pause_ctrl_frame_cntr, TXPF),
XGE_EXTD_STAT(tx_defer_pkt_cntr, TDFR),
XGE_EXTD_STAT(tx_excv_defer_pkt_cntr, TEDF),
XGE_EXTD_STAT(tx_single_col_pkt_cntr, TSCL),
XGE_EXTD_STAT(tx_multi_col_pkt_cntr, TMCL),
XGE_EXTD_STAT(tx_late_col_pkt_cntr, TLCL),
XGE_EXTD_STAT(tx_excv_col_pkt_cntr, TXCL),
XGE_EXTD_STAT(tx_total_col_cntr, TNCL),
XGE_EXTD_STAT(tx_pause_frames_hnrd_cntr, TPFH),
XGE_EXTD_STAT(tx_drop_frame_cntr, TDRP),
XGE_EXTD_STAT(tx_jabber_frame_cntr, TJBR),
XGE_EXTD_STAT(tx_fcs_error_cntr, TFCS),
XGE_EXTD_STAT(tx_ctrl_frame_cntr, TXCF),
XGE_EXTD_STAT(tx_oversize_frame_cntr, TOVR),
XGE_EXTD_STAT(tx_undersize_frame_cntr, TUND),
XGE_EXTD_STAT(tx_fragments_cntr, TFRG)
};
#define XGE_STATS_LEN ARRAY_SIZE(gstrings_stats)
#define XGE_EXTD_STATS_LEN ARRAY_SIZE(gstrings_extd_stats)
static void xge_mac_get_extd_stats(struct xge_pdata *pdata)
{
u32 data;
int i;
for (i = 0; i < XGE_EXTD_STATS_LEN; i++) {
data = xge_rd_csr(pdata, gstrings_extd_stats[i].addr);
gstrings_extd_stats[i].value += data;
}
}
static void xge_get_drvinfo(struct net_device *ndev,
struct ethtool_drvinfo *info)
{
struct xge_pdata *pdata = netdev_priv(ndev);
struct platform_device *pdev = pdata->pdev;
Annotation
- Immediate include surface: `main.h`.
- Detected declarations: `function Copyright`, `function xge_mac_get_extd_stats`, `function xge_get_drvinfo`, `function xge_get_strings`, `function xge_get_sset_count`, `function xge_get_ethtool_stats`, `function xge_get_link_ksettings`, `function xge_set_link_ksettings`, `function xge_set_ethtool_ops`.
- 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.