drivers/net/ethernet/ti/cpsw_ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/ti/cpsw_ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/ti/cpsw_ethtool.c- Extension
.c- Size
- 19996 bytes
- Lines
- 757
- 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.
- 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/if_ether.hlinux/if_vlan.hlinux/kmemleak.hlinux/module.hlinux/netdevice.hlinux/net_tstamp.hlinux/phy.hlinux/pm_runtime.hlinux/skbuff.hcpsw.hcpts.hcpsw_ale.hcpsw_priv.hdavinci_cpdma.h
Detected Declarations
struct cpsw_hw_statsstruct cpsw_statsfunction cpsw_get_msglevelfunction cpsw_set_msglevelfunction cpsw_get_coalescefunction cpsw_set_coalescefunction cpsw_get_sset_countfunction cpsw_add_ch_stringsfunction cpsw_get_stringsfunction cpsw_get_ethtool_statsfunction cpsw_get_pauseparamfunction cpsw_get_wolfunction cpsw_set_wolfunction cpsw_get_regs_lenfunction cpsw_get_regsfunction cpsw_ethtool_op_beginfunction cpsw_ethtool_op_completefunction cpsw_get_channelsfunction cpsw_get_link_ksettingsfunction cpsw_set_link_ksettingsfunction cpsw_get_eeefunction cpsw_nway_resetfunction cpsw_suspend_data_passfunction cpsw_resume_data_passfunction cpsw_check_ch_settingsfunction cpsw_update_channels_resfunction cpsw_failfunction cpsw_set_channels_commonfunction cpsw_get_ringparamfunction cpsw_set_ringparamfunction cpsw_get_ts_infofunction cpsw_get_ts_infoexport cpsw_get_msglevelexport cpsw_set_msglevelexport cpsw_get_coalesceexport cpsw_set_coalesceexport cpsw_get_sset_countexport cpsw_get_stringsexport cpsw_get_ethtool_statsexport cpsw_get_pauseparamexport cpsw_get_wolexport cpsw_set_wolexport cpsw_get_regs_lenexport cpsw_get_regsexport cpsw_ethtool_op_beginexport cpsw_ethtool_op_completeexport cpsw_get_channelsexport cpsw_get_link_ksettings
Annotated Snippet
struct cpsw_hw_stats {
u32 rxgoodframes;
u32 rxbroadcastframes;
u32 rxmulticastframes;
u32 rxpauseframes;
u32 rxcrcerrors;
u32 rxaligncodeerrors;
u32 rxoversizedframes;
u32 rxjabberframes;
u32 rxundersizedframes;
u32 rxfragments;
u32 __pad_0[2];
u32 rxoctets;
u32 txgoodframes;
u32 txbroadcastframes;
u32 txmulticastframes;
u32 txpauseframes;
u32 txdeferredframes;
u32 txcollisionframes;
u32 txsinglecollframes;
u32 txmultcollframes;
u32 txexcessivecollisions;
u32 txlatecollisions;
u32 txunderrun;
u32 txcarriersenseerrors;
u32 txoctets;
u32 octetframes64;
u32 octetframes65t127;
u32 octetframes128t255;
u32 octetframes256t511;
u32 octetframes512t1023;
u32 octetframes1024tup;
u32 netoctets;
u32 rxsofoverruns;
u32 rxmofoverruns;
u32 rxdmaoverruns;
};
struct cpsw_stats {
char stat_string[ETH_GSTRING_LEN];
int type;
int sizeof_stat;
int stat_offset;
};
enum {
CPSW_STATS,
CPDMA_RX_STATS,
CPDMA_TX_STATS,
};
#define CPSW_STAT(m) CPSW_STATS, \
sizeof_field(struct cpsw_hw_stats, m), \
offsetof(struct cpsw_hw_stats, m)
#define CPDMA_RX_STAT(m) CPDMA_RX_STATS, \
sizeof_field(struct cpdma_chan_stats, m), \
offsetof(struct cpdma_chan_stats, m)
#define CPDMA_TX_STAT(m) CPDMA_TX_STATS, \
sizeof_field(struct cpdma_chan_stats, m), \
offsetof(struct cpdma_chan_stats, m)
static const struct cpsw_stats cpsw_gstrings_stats[] = {
{ "Good Rx Frames", CPSW_STAT(rxgoodframes) },
{ "Broadcast Rx Frames", CPSW_STAT(rxbroadcastframes) },
{ "Multicast Rx Frames", CPSW_STAT(rxmulticastframes) },
{ "Pause Rx Frames", CPSW_STAT(rxpauseframes) },
{ "Rx CRC Errors", CPSW_STAT(rxcrcerrors) },
{ "Rx Align/Code Errors", CPSW_STAT(rxaligncodeerrors) },
{ "Oversize Rx Frames", CPSW_STAT(rxoversizedframes) },
{ "Rx Jabbers", CPSW_STAT(rxjabberframes) },
{ "Undersize (Short) Rx Frames", CPSW_STAT(rxundersizedframes) },
{ "Rx Fragments", CPSW_STAT(rxfragments) },
{ "Rx Octets", CPSW_STAT(rxoctets) },
{ "Good Tx Frames", CPSW_STAT(txgoodframes) },
{ "Broadcast Tx Frames", CPSW_STAT(txbroadcastframes) },
{ "Multicast Tx Frames", CPSW_STAT(txmulticastframes) },
{ "Pause Tx Frames", CPSW_STAT(txpauseframes) },
{ "Deferred Tx Frames", CPSW_STAT(txdeferredframes) },
{ "Collisions", CPSW_STAT(txcollisionframes) },
{ "Single Collision Tx Frames", CPSW_STAT(txsinglecollframes) },
{ "Multiple Collision Tx Frames", CPSW_STAT(txmultcollframes) },
{ "Excessive Collisions", CPSW_STAT(txexcessivecollisions) },
{ "Late Collisions", CPSW_STAT(txlatecollisions) },
{ "Tx Underrun", CPSW_STAT(txunderrun) },
{ "Carrier Sense Errors", CPSW_STAT(txcarriersenseerrors) },
{ "Tx Octets", CPSW_STAT(txoctets) },
{ "Rx + Tx 64 Octet Frames", CPSW_STAT(octetframes64) },
{ "Rx + Tx 65-127 Octet Frames", CPSW_STAT(octetframes65t127) },
{ "Rx + Tx 128-255 Octet Frames", CPSW_STAT(octetframes128t255) },
{ "Rx + Tx 256-511 Octet Frames", CPSW_STAT(octetframes256t511) },
Annotation
- Immediate include surface: `linux/if_ether.h`, `linux/if_vlan.h`, `linux/kmemleak.h`, `linux/module.h`, `linux/netdevice.h`, `linux/net_tstamp.h`, `linux/phy.h`, `linux/pm_runtime.h`.
- Detected declarations: `struct cpsw_hw_stats`, `struct cpsw_stats`, `function cpsw_get_msglevel`, `function cpsw_set_msglevel`, `function cpsw_get_coalesce`, `function cpsw_set_coalesce`, `function cpsw_get_sset_count`, `function cpsw_add_ch_strings`, `function cpsw_get_strings`, `function cpsw_get_ethtool_stats`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.