drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c- Extension
.c- Size
- 25619 bytes
- Lines
- 717
- 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/netdevice.hlan966x_main.h
Detected Declarations
function lan966x_add_cntfunction lan966x_stats_updatefunction lan966x_get_sset_countfunction lan966x_get_stringsfunction lan966x_get_ethtool_statsfunction lan966x_get_eth_mac_statsfunction lan966x_get_eth_rmon_statsfunction lan966x_get_link_ksettingsfunction lan966x_set_link_ksettingsfunction lan966x_get_pauseparamfunction lan966x_set_pauseparamfunction lan966x_get_ts_infofunction lan966x_check_stats_workfunction lan966x_stats_getfunction lan966x_stats_init
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0+
#include <linux/netdevice.h>
#include "lan966x_main.h"
/* Number of traffic classes */
#define LAN966X_NUM_TC 8
#define LAN966X_STATS_CHECK_DELAY (2 * HZ)
static const struct lan966x_stat_layout lan966x_stats_layout[] = {
{ .name = "rx_octets", .offset = 0x00, },
{ .name = "rx_unicast", .offset = 0x01, },
{ .name = "rx_multicast", .offset = 0x02 },
{ .name = "rx_broadcast", .offset = 0x03 },
{ .name = "rx_short", .offset = 0x04 },
{ .name = "rx_frag", .offset = 0x05 },
{ .name = "rx_jabber", .offset = 0x06 },
{ .name = "rx_crc", .offset = 0x07 },
{ .name = "rx_symbol_err", .offset = 0x08 },
{ .name = "rx_sz_64", .offset = 0x09 },
{ .name = "rx_sz_65_127", .offset = 0x0a},
{ .name = "rx_sz_128_255", .offset = 0x0b},
{ .name = "rx_sz_256_511", .offset = 0x0c },
{ .name = "rx_sz_512_1023", .offset = 0x0d },
{ .name = "rx_sz_1024_1526", .offset = 0x0e },
{ .name = "rx_sz_jumbo", .offset = 0x0f },
{ .name = "rx_pause", .offset = 0x10 },
{ .name = "rx_control", .offset = 0x11 },
{ .name = "rx_long", .offset = 0x12 },
{ .name = "rx_cat_drop", .offset = 0x13 },
{ .name = "rx_red_prio_0", .offset = 0x14 },
{ .name = "rx_red_prio_1", .offset = 0x15 },
{ .name = "rx_red_prio_2", .offset = 0x16 },
{ .name = "rx_red_prio_3", .offset = 0x17 },
{ .name = "rx_red_prio_4", .offset = 0x18 },
{ .name = "rx_red_prio_5", .offset = 0x19 },
{ .name = "rx_red_prio_6", .offset = 0x1a },
{ .name = "rx_red_prio_7", .offset = 0x1b },
{ .name = "rx_yellow_prio_0", .offset = 0x1c },
{ .name = "rx_yellow_prio_1", .offset = 0x1d },
{ .name = "rx_yellow_prio_2", .offset = 0x1e },
{ .name = "rx_yellow_prio_3", .offset = 0x1f },
{ .name = "rx_yellow_prio_4", .offset = 0x20 },
{ .name = "rx_yellow_prio_5", .offset = 0x21 },
{ .name = "rx_yellow_prio_6", .offset = 0x22 },
{ .name = "rx_yellow_prio_7", .offset = 0x23 },
{ .name = "rx_green_prio_0", .offset = 0x24 },
{ .name = "rx_green_prio_1", .offset = 0x25 },
{ .name = "rx_green_prio_2", .offset = 0x26 },
{ .name = "rx_green_prio_3", .offset = 0x27 },
{ .name = "rx_green_prio_4", .offset = 0x28 },
{ .name = "rx_green_prio_5", .offset = 0x29 },
{ .name = "rx_green_prio_6", .offset = 0x2a },
{ .name = "rx_green_prio_7", .offset = 0x2b },
{ .name = "rx_assembly_err", .offset = 0x2c },
{ .name = "rx_smd_err", .offset = 0x2d },
{ .name = "rx_assembly_ok", .offset = 0x2e },
{ .name = "rx_merge_frag", .offset = 0x2f },
{ .name = "rx_pmac_octets", .offset = 0x30, },
{ .name = "rx_pmac_unicast", .offset = 0x31, },
{ .name = "rx_pmac_multicast", .offset = 0x32 },
{ .name = "rx_pmac_broadcast", .offset = 0x33 },
{ .name = "rx_pmac_short", .offset = 0x34 },
{ .name = "rx_pmac_frag", .offset = 0x35 },
{ .name = "rx_pmac_jabber", .offset = 0x36 },
{ .name = "rx_pmac_crc", .offset = 0x37 },
{ .name = "rx_pmac_symbol_err", .offset = 0x38 },
{ .name = "rx_pmac_sz_64", .offset = 0x39 },
{ .name = "rx_pmac_sz_65_127", .offset = 0x3a },
{ .name = "rx_pmac_sz_128_255", .offset = 0x3b },
{ .name = "rx_pmac_sz_256_511", .offset = 0x3c },
{ .name = "rx_pmac_sz_512_1023", .offset = 0x3d },
{ .name = "rx_pmac_sz_1024_1526", .offset = 0x3e },
{ .name = "rx_pmac_sz_jumbo", .offset = 0x3f },
{ .name = "rx_pmac_pause", .offset = 0x40 },
{ .name = "rx_pmac_control", .offset = 0x41 },
{ .name = "rx_pmac_long", .offset = 0x42 },
{ .name = "tx_octets", .offset = 0x80, },
{ .name = "tx_unicast", .offset = 0x81, },
{ .name = "tx_multicast", .offset = 0x82 },
{ .name = "tx_broadcast", .offset = 0x83 },
{ .name = "tx_col", .offset = 0x84 },
{ .name = "tx_drop", .offset = 0x85 },
{ .name = "tx_pause", .offset = 0x86 },
{ .name = "tx_sz_64", .offset = 0x87 },
{ .name = "tx_sz_65_127", .offset = 0x88 },
{ .name = "tx_sz_128_255", .offset = 0x89 },
{ .name = "tx_sz_256_511", .offset = 0x8a },
Annotation
- Immediate include surface: `linux/netdevice.h`, `lan966x_main.h`.
- Detected declarations: `function lan966x_add_cnt`, `function lan966x_stats_update`, `function lan966x_get_sset_count`, `function lan966x_get_strings`, `function lan966x_get_ethtool_stats`, `function lan966x_get_eth_mac_stats`, `function lan966x_get_eth_rmon_stats`, `function lan966x_get_link_ksettings`, `function lan966x_set_link_ksettings`, `function lan966x_get_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.