drivers/net/ethernet/pasemi/pasemi_mac_ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/pasemi/pasemi_mac_ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/pasemi/pasemi_mac_ethtool.c- Extension
.c- Size
- 3235 bytes
- Lines
- 124
- 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
linux/netdevice.hlinux/ethtool.hlinux/pci.hasm/pasemi_dma.hpasemi_mac.h
Detected Declarations
function pasemi_mac_ethtool_get_msglevelfunction pasemi_mac_ethtool_set_msglevelfunction pasemi_mac_ethtool_get_ringparamfunction pasemi_mac_get_sset_countfunction pasemi_mac_get_ethtool_statsfunction pasemi_mac_get_strings
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2006-2008 PA Semi, Inc
*
* Ethtool hooks for the PA Semi PWRficient onchip 1G/10G Ethernet MACs
*/
#include <linux/netdevice.h>
#include <linux/ethtool.h>
#include <linux/pci.h>
#include <asm/pasemi_dma.h>
#include "pasemi_mac.h"
static struct {
const char str[ETH_GSTRING_LEN];
} ethtool_stats_keys[] = {
{ "rx-drops" },
{ "rx-bytes" },
{ "rx-packets" },
{ "rx-broadcast-packets" },
{ "rx-multicast-packets" },
{ "rx-crc-errors" },
{ "rx-undersize-errors" },
{ "rx-oversize-errors" },
{ "rx-short-fragment-errors" },
{ "rx-jabber-errors" },
{ "rx-64-byte-packets" },
{ "rx-65-127-byte-packets" },
{ "rx-128-255-byte-packets" },
{ "rx-256-511-byte-packets" },
{ "rx-512-1023-byte-packets" },
{ "rx-1024-1518-byte-packets" },
{ "rx-pause-frames" },
{ "tx-bytes" },
{ "tx-packets" },
{ "tx-broadcast-packets" },
{ "tx-multicast-packets" },
{ "tx-collisions" },
{ "tx-late-collisions" },
{ "tx-excessive-collisions" },
{ "tx-crc-errors" },
{ "tx-undersize-errors" },
{ "tx-oversize-errors" },
{ "tx-64-byte-packets" },
{ "tx-65-127-byte-packets" },
{ "tx-128-255-byte-packets" },
{ "tx-256-511-byte-packets" },
{ "tx-512-1023-byte-packets" },
{ "tx-1024-1518-byte-packets" },
};
static u32
pasemi_mac_ethtool_get_msglevel(struct net_device *netdev)
{
struct pasemi_mac *mac = netdev_priv(netdev);
return mac->msg_enable;
}
static void
pasemi_mac_ethtool_set_msglevel(struct net_device *netdev,
u32 level)
{
struct pasemi_mac *mac = netdev_priv(netdev);
mac->msg_enable = level;
}
static void
pasemi_mac_ethtool_get_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{
struct pasemi_mac *mac = netdev_priv(netdev);
ering->tx_max_pending = TX_RING_SIZE/2;
ering->tx_pending = RING_USED(mac->tx)/2;
ering->rx_max_pending = RX_RING_SIZE/4;
ering->rx_pending = RING_USED(mac->rx)/4;
}
static int pasemi_mac_get_sset_count(struct net_device *netdev, int sset)
{
switch (sset) {
case ETH_SS_STATS:
return ARRAY_SIZE(ethtool_stats_keys);
default:
return -EOPNOTSUPP;
Annotation
- Immediate include surface: `linux/netdevice.h`, `linux/ethtool.h`, `linux/pci.h`, `asm/pasemi_dma.h`, `pasemi_mac.h`.
- Detected declarations: `function pasemi_mac_ethtool_get_msglevel`, `function pasemi_mac_ethtool_set_msglevel`, `function pasemi_mac_ethtool_get_ringparam`, `function pasemi_mac_get_sset_count`, `function pasemi_mac_get_ethtool_stats`, `function pasemi_mac_get_strings`.
- 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.