drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/pensando/ionic/ionic_ethtool.c- Extension
.c- Size
- 33735 bytes
- Lines
- 1190
- 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
linux/module.hlinux/netdevice.hlinux/sfp.hionic.hionic_bus.hionic_lif.hionic_ethtool.hionic_stats.h
Detected Declarations
function ionic_get_stats_stringsfunction ionic_get_statsfunction ionic_get_stats_countfunction ionic_get_sset_countfunction ionic_get_stringsfunction ionic_get_drvinfofunction ionic_get_regs_lenfunction ionic_get_regsfunction ionic_get_link_ext_statsfunction ionic_get_link_ksettingsfunction ionic_set_link_ksettingsfunction ionic_get_pauseparamfunction ionic_set_pauseparamfunction ionic_get_fecparamfunction ionic_set_fecparamfunction ionic_get_coalescefunction ionic_set_coalescefunction ionic_validate_cmb_configfunction ionic_cmb_rings_togglefunction ionic_get_ringparamfunction ionic_set_ringparamfunction ionic_get_channelsfunction ionic_set_channelsfunction ionic_get_rx_ring_countfunction ionic_get_rxfh_indir_sizefunction ionic_get_rxfh_key_sizefunction ionic_get_rxfhfunction ionic_set_rxfhfunction ionic_set_tunablefunction ionic_get_tunablefunction ionic_do_module_copyfunction ionic_get_module_eeprom_by_pagefunction ionic_get_ts_infofunction ionic_nway_resetfunction ionic_ethtool_set_ops
Annotated Snippet
if (idev->port_info->config.an_enable) {
ethtool_link_ksettings_add_link_mode(ks, advertising,
Autoneg);
ks->base.autoneg = AUTONEG_ENABLE;
}
}
return 0;
}
static int ionic_set_link_ksettings(struct net_device *netdev,
const struct ethtool_link_ksettings *ks)
{
struct ionic_lif *lif = netdev_priv(netdev);
struct ionic_dev *idev = &lif->ionic->idev;
struct ionic *ionic = lif->ionic;
int err = 0;
if (test_bit(IONIC_LIF_F_FW_RESET, lif->state))
return -EBUSY;
/* set autoneg */
if (ks->base.autoneg != idev->port_info->config.an_enable) {
mutex_lock(&ionic->dev_cmd_lock);
ionic_dev_cmd_port_autoneg(idev, ks->base.autoneg);
err = ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT);
mutex_unlock(&ionic->dev_cmd_lock);
if (err)
return err;
}
/* set speed */
if (ks->base.speed != le32_to_cpu(idev->port_info->config.speed)) {
mutex_lock(&ionic->dev_cmd_lock);
ionic_dev_cmd_port_speed(idev, ks->base.speed);
err = ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT);
mutex_unlock(&ionic->dev_cmd_lock);
if (err)
return err;
}
return 0;
}
static void ionic_get_pauseparam(struct net_device *netdev,
struct ethtool_pauseparam *pause)
{
struct ionic_lif *lif = netdev_priv(netdev);
u8 pause_type;
pause->autoneg = 0;
pause_type = lif->ionic->idev.port_info->config.pause_type;
if (pause_type) {
pause->rx_pause = (pause_type & IONIC_PAUSE_F_RX) ? 1 : 0;
pause->tx_pause = (pause_type & IONIC_PAUSE_F_TX) ? 1 : 0;
}
}
static int ionic_set_pauseparam(struct net_device *netdev,
struct ethtool_pauseparam *pause)
{
struct ionic_lif *lif = netdev_priv(netdev);
struct ionic *ionic = lif->ionic;
u32 requested_pause;
int err;
if (test_bit(IONIC_LIF_F_FW_RESET, lif->state))
return -EBUSY;
if (pause->autoneg)
return -EOPNOTSUPP;
/* change both at the same time */
requested_pause = IONIC_PORT_PAUSE_TYPE_LINK;
if (pause->rx_pause)
requested_pause |= IONIC_PAUSE_F_RX;
if (pause->tx_pause)
requested_pause |= IONIC_PAUSE_F_TX;
if (requested_pause == lif->ionic->idev.port_info->config.pause_type)
return 0;
mutex_lock(&ionic->dev_cmd_lock);
ionic_dev_cmd_port_pause(&lif->ionic->idev, requested_pause);
err = ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT);
mutex_unlock(&ionic->dev_cmd_lock);
if (err)
return err;
Annotation
- Immediate include surface: `linux/module.h`, `linux/netdevice.h`, `linux/sfp.h`, `ionic.h`, `ionic_bus.h`, `ionic_lif.h`, `ionic_ethtool.h`, `ionic_stats.h`.
- Detected declarations: `function ionic_get_stats_strings`, `function ionic_get_stats`, `function ionic_get_stats_count`, `function ionic_get_sset_count`, `function ionic_get_strings`, `function ionic_get_drvinfo`, `function ionic_get_regs_len`, `function ionic_get_regs`, `function ionic_get_link_ext_stats`, `function ionic_get_link_ksettings`.
- 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.