drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_ethtool.c- Extension
.c- Size
- 9658 bytes
- Lines
- 270
- 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/pci.hlinux/netdevice.hlinux/ethtool.hoctep_vf_config.hoctep_vf_main.h
Detected Declarations
function octep_vf_get_drvinfofunction octep_vf_get_stringsfunction octep_vf_get_sset_countfunction octep_vf_get_ethtool_statsfunction octep_vf_get_link_ksettingsfunction octep_vf_get_channelsfunction octep_vf_set_ethtool_ops
Annotated Snippet
if (link_info->autoneg & OCTEP_VF_LINK_MODE_AUTONEG_ADVERTISED) {
ethtool_link_ksettings_add_link_mode(cmd, advertising, Autoneg);
cmd->base.autoneg = AUTONEG_ENABLE;
} else {
cmd->base.autoneg = AUTONEG_DISABLE;
}
} else {
cmd->base.autoneg = AUTONEG_DISABLE;
}
cmd->base.port = PORT_FIBRE;
ethtool_link_ksettings_add_link_mode(cmd, supported, FIBRE);
ethtool_link_ksettings_add_link_mode(cmd, advertising, FIBRE);
if (netif_carrier_ok(netdev)) {
cmd->base.speed = link_info->speed;
cmd->base.duplex = DUPLEX_FULL;
} else {
cmd->base.speed = SPEED_UNKNOWN;
cmd->base.duplex = DUPLEX_UNKNOWN;
}
return 0;
}
static void octep_vf_get_channels(struct net_device *dev,
struct ethtool_channels *channel)
{
struct octep_vf_device *oct = netdev_priv(dev);
channel->max_combined = CFG_GET_PORTS_MAX_IO_RINGS(oct->conf);
channel->combined_count = CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf);
}
static const struct ethtool_ops octep_vf_ethtool_ops = {
.get_drvinfo = octep_vf_get_drvinfo,
.get_link = ethtool_op_get_link,
.get_strings = octep_vf_get_strings,
.get_sset_count = octep_vf_get_sset_count,
.get_ethtool_stats = octep_vf_get_ethtool_stats,
.get_link_ksettings = octep_vf_get_link_ksettings,
.get_channels = octep_vf_get_channels,
};
void octep_vf_set_ethtool_ops(struct net_device *netdev)
{
netdev->ethtool_ops = &octep_vf_ethtool_ops;
}
Annotation
- Immediate include surface: `linux/pci.h`, `linux/netdevice.h`, `linux/ethtool.h`, `octep_vf_config.h`, `octep_vf_main.h`.
- Detected declarations: `function octep_vf_get_drvinfo`, `function octep_vf_get_strings`, `function octep_vf_get_sset_count`, `function octep_vf_get_ethtool_stats`, `function octep_vf_get_link_ksettings`, `function octep_vf_get_channels`, `function octep_vf_set_ethtool_ops`.
- 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.