drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c- Extension
.c- Size
- 14644 bytes
- Lines
- 536
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/string.hlinux/of.hlinux/of_platform.hlinux/platform_device.hlinux/net_tstamp.hlinux/fsl/ptp_qoriq.hdpaa_eth.hmac.h
Detected Declarations
function dpaa_get_link_ksettingsfunction dpaa_set_link_ksettingsfunction dpaa_get_drvinfofunction dpaa_get_msglevelfunction dpaa_set_msglevelfunction dpaa_nway_resetfunction dpaa_get_pauseparamfunction dpaa_set_pauseparamfunction dpaa_get_sset_countfunction copy_statsfunction dpaa_get_ethtool_statsfunction for_each_online_cpufunction dpaa_get_stringsfunction dpaa_get_rxfh_fieldsfunction dpaa_set_hashfunction dpaa_set_rxfh_fieldsfunction dpaa_get_ts_infofunction dpaa_get_coalescefunction dpaa_set_coalescefunction dpaa_get_pause_statsfunction dpaa_get_rmon_statsfunction dpaa_get_eth_ctrl_statsfunction dpaa_get_eth_mac_stats
Annotated Snippet
if (res) {
qman_portal_set_iperiod(portal, prev_period);
goto revert_values;
}
needs_revert[cpu] = true;
}
kfree(needs_revert);
return 0;
revert_values:
/* restore previous values */
for_each_cpu_and(cpu, cpus, cpu_online_mask) {
if (!needs_revert[cpu])
continue;
portal = qman_get_affine_portal(cpu);
/* previous values will not fail, ignore return value */
qman_portal_set_iperiod(portal, prev_period);
qman_dqrr_set_ithresh(portal, prev_thresh);
}
kfree(needs_revert);
return res;
}
static void dpaa_get_pause_stats(struct net_device *net_dev,
struct ethtool_pause_stats *s)
{
struct dpaa_priv *priv = netdev_priv(net_dev);
struct mac_device *mac_dev = priv->mac_dev;
if (mac_dev->get_pause_stats)
mac_dev->get_pause_stats(mac_dev->fman_mac, s);
}
static void dpaa_get_rmon_stats(struct net_device *net_dev,
struct ethtool_rmon_stats *s,
const struct ethtool_rmon_hist_range **ranges)
{
struct dpaa_priv *priv = netdev_priv(net_dev);
struct mac_device *mac_dev = priv->mac_dev;
if (mac_dev->get_rmon_stats)
mac_dev->get_rmon_stats(mac_dev->fman_mac, s, ranges);
}
static void dpaa_get_eth_ctrl_stats(struct net_device *net_dev,
struct ethtool_eth_ctrl_stats *s)
{
struct dpaa_priv *priv = netdev_priv(net_dev);
struct mac_device *mac_dev = priv->mac_dev;
if (mac_dev->get_eth_ctrl_stats)
mac_dev->get_eth_ctrl_stats(mac_dev->fman_mac, s);
}
static void dpaa_get_eth_mac_stats(struct net_device *net_dev,
struct ethtool_eth_mac_stats *s)
{
struct dpaa_priv *priv = netdev_priv(net_dev);
struct mac_device *mac_dev = priv->mac_dev;
if (mac_dev->get_eth_mac_stats)
mac_dev->get_eth_mac_stats(mac_dev->fman_mac, s);
}
const struct ethtool_ops dpaa_ethtool_ops = {
.supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS |
ETHTOOL_COALESCE_RX_MAX_FRAMES,
.get_drvinfo = dpaa_get_drvinfo,
.get_msglevel = dpaa_get_msglevel,
.set_msglevel = dpaa_set_msglevel,
.nway_reset = dpaa_nway_reset,
.get_pauseparam = dpaa_get_pauseparam,
.set_pauseparam = dpaa_set_pauseparam,
.get_link = ethtool_op_get_link,
.get_sset_count = dpaa_get_sset_count,
.get_ethtool_stats = dpaa_get_ethtool_stats,
.get_strings = dpaa_get_strings,
.get_link_ksettings = dpaa_get_link_ksettings,
.set_link_ksettings = dpaa_set_link_ksettings,
.get_rxfh_fields = dpaa_get_rxfh_fields,
.set_rxfh_fields = dpaa_set_rxfh_fields,
.get_ts_info = dpaa_get_ts_info,
.get_coalesce = dpaa_get_coalesce,
.set_coalesce = dpaa_set_coalesce,
.get_pause_stats = dpaa_get_pause_stats,
.get_rmon_stats = dpaa_get_rmon_stats,
Annotation
- Immediate include surface: `linux/string.h`, `linux/of.h`, `linux/of_platform.h`, `linux/platform_device.h`, `linux/net_tstamp.h`, `linux/fsl/ptp_qoriq.h`, `dpaa_eth.h`, `mac.h`.
- Detected declarations: `function dpaa_get_link_ksettings`, `function dpaa_set_link_ksettings`, `function dpaa_get_drvinfo`, `function dpaa_get_msglevel`, `function dpaa_set_msglevel`, `function dpaa_nway_reset`, `function dpaa_get_pauseparam`, `function dpaa_set_pauseparam`, `function dpaa_get_sset_count`, `function copy_stats`.
- 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.