linux/drivers/net/ethernet/sfc/falcon/ethtool.c

// 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 "filter.h"
#include "nic.h"

struct ef4_sw_stat_desc {};

/* Initialiser for a struct ef4_sw_stat_desc with type-checking */
#define EF4_ETHTOOL_STAT(stat_name, source_name, field, field_type, \
				get_stat_function)

static u64 ef4_get_uint_stat(void *field)
{}

static u64 ef4_get_atomic_stat(void *field)
{}

#define EF4_ETHTOOL_ATOMIC_NIC_ERROR_STAT(field)

#define EF4_ETHTOOL_UINT_CHANNEL_STAT(field)

#define EF4_ETHTOOL_UINT_TXQ_STAT(field)

static const struct ef4_sw_stat_desc ef4_sw_stat_desc[] =;

#define EF4_ETHTOOL_SW_STAT_COUNT

#define EF4_ETHTOOL_EEPROM_MAGIC

/**************************************************************************
 *
 * Ethtool operations
 *
 **************************************************************************
 */

/* Identify device by flashing LEDs */
static int ef4_ethtool_phys_id(struct net_device *net_dev,
			       enum ethtool_phys_id_state state)
{}

/* This must be called with rtnl_lock held. */
static int
ef4_ethtool_get_link_ksettings(struct net_device *net_dev,
			       struct ethtool_link_ksettings *cmd)
{}

/* This must be called with rtnl_lock held. */
static int
ef4_ethtool_set_link_ksettings(struct net_device *net_dev,
			       const struct ethtool_link_ksettings *cmd)
{}

static void ef4_ethtool_get_drvinfo(struct net_device *net_dev,
				    struct ethtool_drvinfo *info)
{}

static int ef4_ethtool_get_regs_len(struct net_device *net_dev)
{}

static void ef4_ethtool_get_regs(struct net_device *net_dev,
				 struct ethtool_regs *regs, void *buf)
{}

static u32 ef4_ethtool_get_msglevel(struct net_device *net_dev)
{}

static void ef4_ethtool_set_msglevel(struct net_device *net_dev, u32 msg_enable)
{}

/**
 * ef4_fill_test - fill in an individual self-test entry
 * @test_index:		Index of the test
 * @strings:		Ethtool strings, or %NULL
 * @data:		Ethtool test results, or %NULL
 * @test:		Pointer to test result (used only if data != %NULL)
 * @unit_format:	Unit name format (e.g. "chan\%d")
 * @unit_id:		Unit id (e.g. 0 for "chan0")
 * @test_format:	Test name format (e.g. "loopback.\%s.tx.sent")
 * @test_id:		Test id (e.g. "PHYXS" for "loopback.PHYXS.tx_sent")
 *
 * Fill in an individual self-test entry.
 */
static void ef4_fill_test(unsigned int test_index, u8 *strings, u64 *data,
			  int *test, const char *unit_format, int unit_id,
			  const char *test_format, const char *test_id)
{}

#define EF4_CHANNEL_NAME(_channel)
#define EF4_TX_QUEUE_NAME(_tx_queue)
#define EF4_RX_QUEUE_NAME(_rx_queue)
#define EF4_LOOPBACK_NAME(_mode, _counter)

/**
 * ef4_fill_loopback_test - fill in a block of loopback self-test entries
 * @efx:		Efx NIC
 * @lb_tests:		Efx loopback self-test results structure
 * @mode:		Loopback test mode
 * @test_index:		Starting index of the test
 * @strings:		Ethtool strings, or %NULL
 * @data:		Ethtool test results, or %NULL
 *
 * Fill in a block of loopback self-test entries.  Return new test
 * index.
 */
static int ef4_fill_loopback_test(struct ef4_nic *efx,
				  struct ef4_loopback_self_tests *lb_tests,
				  enum ef4_loopback_mode mode,
				  unsigned int test_index,
				  u8 *strings, u64 *data)
{}

/**
 * ef4_ethtool_fill_self_tests - get self-test details
 * @efx:		Efx NIC
 * @tests:		Efx self-test results structure, or %NULL
 * @strings:		Ethtool strings, or %NULL
 * @data:		Ethtool test results, or %NULL
 *
 * Get self-test number of strings, strings, and/or test results.
 * Return number of strings (== number of test results).
 *
 * The reason for merging these three functions is to make sure that
 * they can never be inconsistent.
 */
static int ef4_ethtool_fill_self_tests(struct ef4_nic *efx,
				       struct ef4_self_tests *tests,
				       u8 *strings, u64 *data)
{}

static size_t ef4_describe_per_queue_stats(struct ef4_nic *efx, u8 *strings)
{}

static int ef4_ethtool_get_sset_count(struct net_device *net_dev,
				      int string_set)
{}

static void ef4_ethtool_get_strings(struct net_device *net_dev,
				    u32 string_set, u8 *strings)
{}

static void ef4_ethtool_get_stats(struct net_device *net_dev,
				  struct ethtool_stats *stats,
				  u64 *data)
{}

static void ef4_ethtool_self_test(struct net_device *net_dev,
				  struct ethtool_test *test, u64 *data)
{}

/* Restart autonegotiation */
static int ef4_ethtool_nway_reset(struct net_device *net_dev)
{}

/*
 * 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 ef4_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 ef4_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
ef4_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
ef4_ethtool_set_ringparam(struct net_device *net_dev,
			  struct ethtool_ringparam *ring,
			  struct kernel_ethtool_ringparam *kernel_ring,
			  struct netlink_ext_ack *extack)
{}

static int ef4_ethtool_set_pauseparam(struct net_device *net_dev,
				      struct ethtool_pauseparam *pause)
{}

static void ef4_ethtool_get_pauseparam(struct net_device *net_dev,
				       struct ethtool_pauseparam *pause)
{}

static void ef4_ethtool_get_wol(struct net_device *net_dev,
				struct ethtool_wolinfo *wol)
{}


static int ef4_ethtool_set_wol(struct net_device *net_dev,
			       struct ethtool_wolinfo *wol)
{}

static int ef4_ethtool_reset(struct net_device *net_dev, u32 *flags)
{}

/* MAC address mask including only I/G bit */
static const u8 mac_addr_ig_mask[ETH_ALEN] __aligned(2) =;

#define IP4_ADDR_FULL_MASK
#define IP_PROTO_FULL_MASK
#define PORT_FULL_MASK
#define ETHER_TYPE_FULL_MASK

static inline void ip6_fill_mask(__be32 *mask)
{}

static int ef4_ethtool_get_class_rule(struct ef4_nic *efx,
				      struct ethtool_rx_flow_spec *rule)
{}

static int
ef4_ethtool_get_rxnfc(struct net_device *net_dev,
		      struct ethtool_rxnfc *info, u32 *rule_locs)
{}

static inline bool ip6_mask_is_full(__be32 mask[4])
{}

static inline bool ip6_mask_is_empty(__be32 mask[4])
{}

static int ef4_ethtool_set_class_rule(struct ef4_nic *efx,
				      struct ethtool_rx_flow_spec *rule)
{}

static int ef4_ethtool_set_rxnfc(struct net_device *net_dev,
				 struct ethtool_rxnfc *info)
{}

static u32 ef4_ethtool_get_rxfh_indir_size(struct net_device *net_dev)
{}

static int ef4_ethtool_get_rxfh(struct net_device *net_dev,
				struct ethtool_rxfh_param *rxfh)
{}

static int ef4_ethtool_set_rxfh(struct net_device *net_dev,
				struct ethtool_rxfh_param *rxfh,
				struct netlink_ext_ack *extack)
{}

static int ef4_ethtool_get_module_eeprom(struct net_device *net_dev,
					 struct ethtool_eeprom *ee,
					 u8 *data)
{}

static int ef4_ethtool_get_module_info(struct net_device *net_dev,
				       struct ethtool_modinfo *modinfo)
{}

const struct ethtool_ops ef4_ethtool_ops =;