drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c- Extension
.c- Size
- 28856 bytes
- Lines
- 1132
- 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
aq_ethtool.haq_nic.haq_vec.haq_ptp.haq_filters.haq_macsec.haq_main.hlinux/ethtool.hlinux/linkmode.hlinux/ptp_clock_kernel.h
Detected Declarations
function Copyrightfunction aq_ethtool_get_regs_lenfunction aq_ethtool_get_linkfunction aq_ethtool_get_link_ksettingsfunction aq_ethtool_set_link_ksettingsfunction aq_ethtool_n_statsfunction aq_ethtool_statsfunction aq_ethtool_get_drvinfofunction aq_ethtool_get_stringsfunction aq_ethtool_set_phys_idfunction aq_ethtool_get_sset_countfunction aq_ethtool_get_rss_indir_sizefunction aq_ethtool_get_rss_key_sizefunction aq_ethtool_get_rssfunction aq_ethtool_set_rssfunction aq_ethtool_get_rx_ring_countfunction aq_ethtool_get_rxnfcfunction aq_ethtool_set_rxnfcfunction aq_ethtool_get_coalescefunction aq_ethtool_set_coalescefunction aq_ethtool_get_wolfunction aq_ethtool_set_wolfunction aq_ethtool_get_ts_infofunction eee_mask_to_ethtool_maskfunction aq_ethtool_get_eeefunction aq_ethtool_set_eeefunction aq_ethtool_nway_resetfunction aq_ethtool_get_pauseparamfunction aq_ethtool_set_pauseparamfunction aq_get_ringparamfunction aq_set_ringparamfunction aq_get_msg_levelfunction aq_set_msg_levelfunction aq_ethtool_get_priv_flagsfunction aq_ethtool_set_priv_flagsfunction aq_ethtool_get_phy_tunablefunction aq_ethtool_set_phy_tunablefunction aq_ethtool_can_read_module_eepromfunction aq_ethtool_read_module_eepromfunction aq_ethtool_get_module_infofunction aq_ethtool_get_module_eeprom
Annotated Snippet
if (nic->aq_ptp) {
const int rx_ring_cnt = aq_ptp_get_ring_cnt(nic, ATL_RING_RX);
const int tx_ring_cnt = aq_ptp_get_ring_cnt(nic, ATL_RING_TX);
unsigned int ptp_ring_idx =
aq_ptp_ring_idx(nic->aq_nic_cfg.tc_mode);
snprintf(tc_string, 8, "PTP ");
for (i = 0; i < max(rx_ring_cnt, tx_ring_cnt); i++) {
for (si = 0; si < rx_stat_cnt; si++) {
ethtool_sprintf(&p,
aq_ethtool_queue_rx_stat_names[si],
tc_string,
i ? PTP_HWST_RING_IDX : ptp_ring_idx);
}
if (i >= tx_ring_cnt)
continue;
for (si = 0; si < tx_stat_cnt; si++) {
ethtool_sprintf(&p,
aq_ethtool_queue_tx_stat_names[si],
tc_string,
i ? PTP_HWST_RING_IDX : ptp_ring_idx);
}
}
}
#endif
#if IS_ENABLED(CONFIG_MACSEC)
if (!nic->macsec_cfg)
break;
memcpy(p, aq_macsec_stat_names, sizeof(aq_macsec_stat_names));
p = p + sizeof(aq_macsec_stat_names);
for (i = 0; i < AQ_MACSEC_MAX_SC; i++) {
struct aq_macsec_txsc *aq_txsc;
if (!(test_bit(i, &nic->macsec_cfg->txsc_idx_busy)))
continue;
for (si = 0;
si < ARRAY_SIZE(aq_macsec_txsc_stat_names);
si++) {
ethtool_sprintf(&p,
aq_macsec_txsc_stat_names[si], i);
}
aq_txsc = &nic->macsec_cfg->aq_txsc[i];
for (sa = 0; sa < MACSEC_NUM_AN; sa++) {
if (!(test_bit(sa, &aq_txsc->tx_sa_idx_busy)))
continue;
for (si = 0;
si < ARRAY_SIZE(aq_macsec_txsa_stat_names);
si++) {
ethtool_sprintf(&p,
aq_macsec_txsa_stat_names[si],
i, sa);
}
}
}
for (i = 0; i < AQ_MACSEC_MAX_SC; i++) {
struct aq_macsec_rxsc *aq_rxsc;
if (!(test_bit(i, &nic->macsec_cfg->rxsc_idx_busy)))
continue;
aq_rxsc = &nic->macsec_cfg->aq_rxsc[i];
for (sa = 0; sa < MACSEC_NUM_AN; sa++) {
if (!(test_bit(sa, &aq_rxsc->rx_sa_idx_busy)))
continue;
for (si = 0;
si < ARRAY_SIZE(aq_macsec_rxsa_stat_names);
si++) {
ethtool_sprintf(&p,
aq_macsec_rxsa_stat_names[si],
i, sa);
}
}
}
#endif
break;
}
case ETH_SS_PRIV_FLAGS:
memcpy(p, aq_ethtool_priv_flag_names,
sizeof(aq_ethtool_priv_flag_names));
break;
}
}
static int aq_ethtool_set_phys_id(struct net_device *ndev,
enum ethtool_phys_id_state state)
{
struct aq_nic_s *aq_nic = netdev_priv(ndev);
Annotation
- Immediate include surface: `aq_ethtool.h`, `aq_nic.h`, `aq_vec.h`, `aq_ptp.h`, `aq_filters.h`, `aq_macsec.h`, `aq_main.h`, `linux/ethtool.h`.
- Detected declarations: `function Copyright`, `function aq_ethtool_get_regs_len`, `function aq_ethtool_get_link`, `function aq_ethtool_get_link_ksettings`, `function aq_ethtool_set_link_ksettings`, `function aq_ethtool_n_stats`, `function aq_ethtool_stats`, `function aq_ethtool_get_drvinfo`, `function aq_ethtool_get_strings`, `function aq_ethtool_set_phys_id`.
- 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.