drivers/net/ethernet/ti/am65-cpsw-ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/ti/am65-cpsw-ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/ti/am65-cpsw-ethtool.c- Extension
.c- Size
- 31623 bytes
- Lines
- 1011
- 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/net_tstamp.hlinux/phylink.hlinux/platform_device.hlinux/pm_runtime.ham65-cpsw-nuss.ham65-cpsw-qos.hcpsw_ale.ham65-cpts.h
Detected Declarations
struct am65_cpsw_regdump_hdrstruct am65_cpsw_regdump_itemstruct am65_cpsw_stats_regsstruct am65_cpsw_ethtool_statfunction am65_cpsw_ethtool_op_beginfunction am65_cpsw_ethtool_op_completefunction am65_cpsw_get_drvinfofunction am65_cpsw_get_msglevelfunction am65_cpsw_set_msglevelfunction am65_cpsw_get_channelsfunction am65_cpsw_set_channelsfunction am65_cpsw_get_ringparamfunction am65_cpsw_get_pauseparamfunction am65_cpsw_set_pauseparamfunction am65_cpsw_get_wolfunction am65_cpsw_set_wolfunction am65_cpsw_get_link_ksettingsfunction am65_cpsw_set_link_ksettingsfunction am65_cpsw_get_eeefunction am65_cpsw_set_eeefunction am65_cpsw_nway_resetfunction am65_cpsw_get_regs_lenfunction am65_cpsw_get_regsfunction am65_cpsw_get_sset_countfunction am65_cpsw_get_stringsfunction am65_cpsw_get_ethtool_statsfunction am65_cpsw_get_eth_mac_statsfunction am65_cpsw_get_ethtool_ts_infofunction am65_cpsw_get_ethtool_priv_flagsfunction am65_cpsw_set_ethtool_priv_flagsfunction am65_cpsw_port_iet_rx_enablefunction am65_cpsw_port_iet_tx_enablefunction am65_cpsw_get_mmfunction am65_cpsw_set_mmfunction am65_cpsw_get_mm_statsfunction am65_cpsw_get_per_queue_coalescefunction am65_cpsw_get_coalescefunction am65_cpsw_set_per_queue_coalescefunction am65_cpsw_set_coalesce
Annotated Snippet
struct am65_cpsw_regdump_hdr {
u32 module_id;
u32 len;
};
/**
* struct am65_cpsw_regdump_item - regdump module description
*
* @hdr: CPSW module header
* @start_ofs: CPSW module registers start addr
* @end_ofs: CPSW module registers end addr
*
* Registers dump provided in the format:
* u32 : module ID
* u32 : dump length
* u32[..len]: registers values
*/
struct am65_cpsw_regdump_item {
struct am65_cpsw_regdump_hdr hdr;
u32 start_ofs;
u32 end_ofs;
};
#define AM65_CPSW_REGDUMP_REC(mod, start, end) { \
.hdr.module_id = (mod), \
.hdr.len = (end + 4 - start) * 2 + \
sizeof(struct am65_cpsw_regdump_hdr), \
.start_ofs = (start), \
.end_ofs = end, \
}
static const struct am65_cpsw_regdump_item am65_cpsw_regdump[] = {
AM65_CPSW_REGDUMP_REC(AM65_CPSW_REGDUMP_MOD_NUSS, 0x0, 0x1c),
AM65_CPSW_REGDUMP_REC(AM65_CPSW_REGDUMP_MOD_RGMII_STATUS, 0x30, 0x4c),
AM65_CPSW_REGDUMP_REC(AM65_CPSW_REGDUMP_MOD_MDIO, 0xf00, 0xffc),
AM65_CPSW_REGDUMP_REC(AM65_CPSW_REGDUMP_MOD_CPSW, 0x20000, 0x2011c),
AM65_CPSW_REGDUMP_REC(AM65_CPSW_REGDUMP_MOD_CPSW_P0, 0x21000, 0x21320),
AM65_CPSW_REGDUMP_REC(AM65_CPSW_REGDUMP_MOD_CPSW_P1, 0x22000, 0x223a4),
AM65_CPSW_REGDUMP_REC(AM65_CPSW_REGDUMP_MOD_CPSW_CPTS,
0x3d000, 0x3d048),
AM65_CPSW_REGDUMP_REC(AM65_CPSW_REGDUMP_MOD_CPSW_ALE, 0x3e000, 0x3e13c),
AM65_CPSW_REGDUMP_REC(AM65_CPSW_REGDUMP_MOD_CPSW_ALE_TBL, 0, 0),
};
struct am65_cpsw_stats_regs {
u32 rx_good_frames;
u32 rx_broadcast_frames;
u32 rx_multicast_frames;
u32 rx_pause_frames; /* slave */
u32 rx_crc_errors;
u32 rx_align_code_errors; /* slave */
u32 rx_oversized_frames;
u32 rx_jabber_frames; /* slave */
u32 rx_undersized_frames;
u32 rx_fragments; /* slave */
u32 ale_drop;
u32 ale_overrun_drop;
u32 rx_octets;
u32 tx_good_frames;
u32 tx_broadcast_frames;
u32 tx_multicast_frames;
u32 tx_pause_frames; /* slave */
u32 tx_deferred_frames; /* slave */
u32 tx_collision_frames; /* slave */
u32 tx_single_coll_frames; /* slave */
u32 tx_mult_coll_frames; /* slave */
u32 tx_excessive_collisions; /* slave */
u32 tx_late_collisions; /* slave */
u32 rx_ipg_error; /* slave 10G only */
u32 tx_carrier_sense_errors; /* slave */
u32 tx_octets;
u32 tx_64B_frames;
u32 tx_65_to_127B_frames;
u32 tx_128_to_255B_frames;
u32 tx_256_to_511B_frames;
u32 tx_512_to_1023B_frames;
u32 tx_1024B_frames;
u32 net_octets;
u32 rx_bottom_fifo_drop;
u32 rx_port_mask_drop;
u32 rx_top_fifo_drop;
u32 ale_rate_limit_drop;
u32 ale_vid_ingress_drop;
u32 ale_da_eq_sa_drop;
u32 ale_block_drop; /* K3 */
u32 ale_secure_drop; /* K3 */
u32 ale_auth_drop; /* K3 */
u32 ale_unknown_ucast;
u32 ale_unknown_ucast_bytes;
u32 ale_unknown_mcast;
Annotation
- Immediate include surface: `linux/net_tstamp.h`, `linux/phylink.h`, `linux/platform_device.h`, `linux/pm_runtime.h`, `am65-cpsw-nuss.h`, `am65-cpsw-qos.h`, `cpsw_ale.h`, `am65-cpts.h`.
- Detected declarations: `struct am65_cpsw_regdump_hdr`, `struct am65_cpsw_regdump_item`, `struct am65_cpsw_stats_regs`, `struct am65_cpsw_ethtool_stat`, `function am65_cpsw_ethtool_op_begin`, `function am65_cpsw_ethtool_op_complete`, `function am65_cpsw_get_drvinfo`, `function am65_cpsw_get_msglevel`, `function am65_cpsw_set_msglevel`, `function am65_cpsw_get_channels`.
- 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.