drivers/net/ethernet/fungible/funeth/funeth_ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/fungible/funeth/funeth_ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/fungible/funeth/funeth_ethtool.c- Extension
.c- Size
- 33571 bytes
- Lines
- 1189
- 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/ethtool.hlinux/linkmode.hlinux/netdevice.hlinux/nvme.hlinux/io.hlinux/io-64-nonatomic-lo-hi.hlinux/pci.hlinux/rtnetlink.hfuneth.hfun_port.hfuneth_txrx.h
Detected Declarations
function fun_link_modes_to_ethtoolfunction set_asym_pausefunction fun_port_typefunction fun_get_link_ksettingsfunction fun_advert_modesfunction fun_speed_to_link_modefunction fun_change_advertfunction fun_set_link_ksettingsfunction fun_get_pauseparamfunction fun_set_pauseparamfunction fun_restart_anfunction fun_set_phys_idfunction fun_get_drvinfofunction fun_get_msglevelfunction fun_set_msglevelfunction fun_get_regs_lenfunction fun_get_regsfunction fun_get_coalescefunction fun_set_coalescefunction fun_get_channelsfunction fun_set_channelsfunction fun_get_ringparamfunction fun_set_ringparamfunction fun_get_sset_countfunction fun_get_stringsfunction fun_get_ethtool_statsfunction fun_get_pause_statsfunction fun_get_802_3_statsfunction fun_get_802_3_ctrl_statsfunction fun_get_rmon_statsfunction fun_get_fec_statsfunction fun_get_rx_ring_countfunction fun_set_rxnfcfunction fun_get_rxfh_indir_sizefunction fun_get_rxfh_key_sizefunction fun_get_rxfhfunction fun_set_rxfhfunction fun_get_ts_infofunction to_ethtool_fecfunction fun_get_fecparamfunction fun_set_fecparamfunction fun_get_port_module_pagefunction fun_set_ethtool_ops
Annotated Snippet
if (fp->port_caps & FUN_PORT_CAP_STATS) {
n += ARRAY_SIZE(mac_tx_stat_names) +
ARRAY_SIZE(mac_rx_stat_names);
}
return n;
default:
break;
}
return 0;
}
static void fun_get_strings(struct net_device *netdev, u32 sset, u8 *data)
{
const struct funeth_priv *fp = netdev_priv(netdev);
unsigned int i, j;
u8 *p = data;
switch (sset) {
case ETH_SS_STATS:
if (fp->port_caps & FUN_PORT_CAP_STATS) {
memcpy(p, mac_tx_stat_names, sizeof(mac_tx_stat_names));
p += sizeof(mac_tx_stat_names);
memcpy(p, mac_rx_stat_names, sizeof(mac_rx_stat_names));
p += sizeof(mac_rx_stat_names);
}
for (i = 0; i < netdev->real_num_tx_queues; i++) {
for (j = 0; j < ARRAY_SIZE(txq_stat_names); j++)
ethtool_sprintf(&p, "%s[%u]", txq_stat_names[j],
i);
}
for (j = 0; j < ARRAY_SIZE(txq_stat_names); j++)
ethtool_puts(&p, txq_stat_names[j]);
for (i = 0; i < fp->num_xdpqs; i++) {
for (j = 0; j < ARRAY_SIZE(xdpq_stat_names); j++)
ethtool_sprintf(&p, "%s[%u]",
xdpq_stat_names[j], i);
}
for (j = 0; j < ARRAY_SIZE(xdpq_stat_names); j++)
ethtool_puts(&p, xdpq_stat_names[j]);
for (i = 0; i < netdev->real_num_rx_queues; i++) {
for (j = 0; j < ARRAY_SIZE(rxq_stat_names); j++)
ethtool_sprintf(&p, "%s[%u]", rxq_stat_names[j],
i);
}
for (j = 0; j < ARRAY_SIZE(rxq_stat_names); j++)
ethtool_puts(&p, rxq_stat_names[j]);
for (j = 0; j < ARRAY_SIZE(tls_stat_names); j++)
ethtool_puts(&p, tls_stat_names[j]);
break;
default:
break;
}
}
static u64 *get_mac_stats(const struct funeth_priv *fp, u64 *data)
{
#define TX_STAT(s) \
*data++ = be64_to_cpu(fp->stats[PORT_MAC_RX_STATS_MAX + PORT_MAC_TX_##s])
TX_STAT(etherStatsOctets);
TX_STAT(etherStatsPkts);
TX_STAT(VLANTransmittedOK);
TX_STAT(ifOutUcastPkts);
TX_STAT(ifOutMulticastPkts);
TX_STAT(ifOutBroadcastPkts);
TX_STAT(ifOutErrors);
TX_STAT(CBFCPAUSEFramesTransmitted_0);
TX_STAT(CBFCPAUSEFramesTransmitted_1);
TX_STAT(CBFCPAUSEFramesTransmitted_2);
TX_STAT(CBFCPAUSEFramesTransmitted_3);
TX_STAT(CBFCPAUSEFramesTransmitted_4);
TX_STAT(CBFCPAUSEFramesTransmitted_5);
TX_STAT(CBFCPAUSEFramesTransmitted_6);
TX_STAT(CBFCPAUSEFramesTransmitted_7);
TX_STAT(CBFCPAUSEFramesTransmitted_8);
TX_STAT(CBFCPAUSEFramesTransmitted_9);
TX_STAT(CBFCPAUSEFramesTransmitted_10);
TX_STAT(CBFCPAUSEFramesTransmitted_11);
TX_STAT(CBFCPAUSEFramesTransmitted_12);
TX_STAT(CBFCPAUSEFramesTransmitted_13);
TX_STAT(CBFCPAUSEFramesTransmitted_14);
TX_STAT(CBFCPAUSEFramesTransmitted_15);
#define RX_STAT(s) *data++ = be64_to_cpu(fp->stats[PORT_MAC_RX_##s])
RX_STAT(etherStatsOctets);
Annotation
- Immediate include surface: `linux/ethtool.h`, `linux/linkmode.h`, `linux/netdevice.h`, `linux/nvme.h`, `linux/io.h`, `linux/io-64-nonatomic-lo-hi.h`, `linux/pci.h`, `linux/rtnetlink.h`.
- Detected declarations: `function fun_link_modes_to_ethtool`, `function set_asym_pause`, `function fun_port_type`, `function fun_get_link_ksettings`, `function fun_advert_modes`, `function fun_speed_to_link_mode`, `function fun_change_advert`, `function fun_set_link_ksettings`, `function fun_get_pauseparam`, `function fun_set_pauseparam`.
- 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.