// SPDX-License-Identifier: GPL-2.0-only /**************************************************************************** * Driver for Solarflare network controllers and boards * Copyright 2005-2006 Fen Systems Ltd. * Copyright 2006-2013 Solarflare Communications Inc. */ #include <linux/netdevice.h> #include <linux/ethtool.h> #include <linux/rtnetlink.h> #include <linux/in.h> #include "net_driver.h" #include "workarounds.h" #include "selftest.h" #include "efx.h" #include "efx_channels.h" #include "rx_common.h" #include "tx_common.h" #include "ethtool_common.h" #include "filter.h" #include "nic.h" #define EFX_ETHTOOL_EEPROM_MAGIC … /************************************************************************** * * Ethtool operations * ************************************************************************** */ /* Identify device by flashing LEDs */ static int efx_ethtool_phys_id(struct net_device *net_dev, enum ethtool_phys_id_state state) { … } static int efx_ethtool_get_regs_len(struct net_device *net_dev) { … } static void efx_ethtool_get_regs(struct net_device *net_dev, struct ethtool_regs *regs, void *buf) { … } /* * Each channel has a single IRQ and moderation timer, started by any * completion (or other event). Unless the module parameter * separate_tx_channels is set, IRQs and moderation are therefore * shared between RX and TX completions. In this case, when RX IRQ * moderation is explicitly changed then TX IRQ moderation is * automatically changed too, but otherwise we fail if the two values * are requested to be different. * * The hardware does not support a limit on the number of completions * before an IRQ, so we do not use the max_frames fields. We should * report and require that max_frames == (usecs != 0), but this would * invalidate existing user documentation. * * The hardware does not have distinct settings for interrupt * moderation while the previous IRQ is being handled, so we should * not use the 'irq' fields. However, an earlier developer * misunderstood the meaning of the 'irq' fields and the driver did * not support the standard fields. To avoid invalidating existing * user documentation, we report and accept changes through either the * standard or 'irq' fields. If both are changed at the same time, we * prefer the standard field. * * We implement adaptive IRQ moderation, but use a different algorithm * from that assumed in the definition of struct ethtool_coalesce. * Therefore we do not use any of the adaptive moderation parameters * in it. */ static int efx_ethtool_get_coalesce(struct net_device *net_dev, struct ethtool_coalesce *coalesce, struct kernel_ethtool_coalesce *kernel_coal, struct netlink_ext_ack *extack) { … } static int efx_ethtool_set_coalesce(struct net_device *net_dev, struct ethtool_coalesce *coalesce, struct kernel_ethtool_coalesce *kernel_coal, struct netlink_ext_ack *extack) { … } static void efx_ethtool_get_ringparam(struct net_device *net_dev, struct ethtool_ringparam *ring, struct kernel_ethtool_ringparam *kernel_ring, struct netlink_ext_ack *extack) { … } static int efx_ethtool_set_ringparam(struct net_device *net_dev, struct ethtool_ringparam *ring, struct kernel_ethtool_ringparam *kernel_ring, struct netlink_ext_ack *extack) { … } static void efx_ethtool_get_wol(struct net_device *net_dev, struct ethtool_wolinfo *wol) { … } static int efx_ethtool_set_wol(struct net_device *net_dev, struct ethtool_wolinfo *wol) { … } static void efx_ethtool_get_fec_stats(struct net_device *net_dev, struct ethtool_fec_stats *fec_stats) { … } static int efx_ethtool_get_ts_info(struct net_device *net_dev, struct kernel_ethtool_ts_info *ts_info) { … } const struct ethtool_ops efx_ethtool_ops = …;