linux/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 *  Copyright (C) 2013-2015 Chelsio Communications.  All rights reserved.
 */

#include <linux/firmware.h>
#include <linux/mdio.h>

#include "cxgb4.h"
#include "t4_regs.h"
#include "t4fw_api.h"
#include "cxgb4_cudbg.h"
#include "cxgb4_filter.h"
#include "cxgb4_tc_flower.h"

#define EEPROM_MAGIC

static u32 get_msglevel(struct net_device *dev)
{}

static void set_msglevel(struct net_device *dev, u32 val)
{}

enum cxgb4_ethtool_tests {};

static const char cxgb4_selftest_strings[CXGB4_ETHTOOL_MAX_TEST][ETH_GSTRING_LEN] =;

static const char * const flash_region_strings[] =;

static const char stats_strings[][ETH_GSTRING_LEN] =;

static char adapter_stats_strings[][ETH_GSTRING_LEN] =;

static char loopback_stats_strings[][ETH_GSTRING_LEN] =;

static const char cxgb4_priv_flags_strings[][ETH_GSTRING_LEN] =;

static int get_sset_count(struct net_device *dev, int sset)
{}

static int get_regs_len(struct net_device *dev)
{}

static int get_eeprom_len(struct net_device *dev)
{}

static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
{}

static void get_strings(struct net_device *dev, u32 stringset, u8 *data)
{}

/* port stats maintained per queue of the port. They should be in the same
 * order as in stats_strings above.
 */
struct queue_port_stats {};

struct adapter_stats {};

static void collect_sge_port_stats(const struct adapter *adap,
				   const struct port_info *p,
				   struct queue_port_stats *s)
{}

static void collect_adapter_stats(struct adapter *adap, struct adapter_stats *s)
{}

static void get_stats(struct net_device *dev, struct ethtool_stats *stats,
		      u64 *data)
{}

static void get_regs(struct net_device *dev, struct ethtool_regs *regs,
		     void *buf)
{}

static int restart_autoneg(struct net_device *dev)
{}

static int identify_port(struct net_device *dev,
			 enum ethtool_phys_id_state state)
{}

/**
 *	from_fw_port_mod_type - translate Firmware Port/Module type to Ethtool
 *	@port_type: Firmware Port Type
 *	@mod_type: Firmware Module Type
 *
 *	Translate Firmware Port/Module type to Ethtool Port Type.
 */
static int from_fw_port_mod_type(enum fw_port_type port_type,
				 enum fw_port_module_type mod_type)
{}

/**
 *	speed_to_fw_caps - translate Port Speed to Firmware Port Capabilities
 *	@speed: speed in Kb/s
 *
 *	Translates a specific Port Speed into a Firmware Port Capabilities
 *	value.
 */
static unsigned int speed_to_fw_caps(int speed)
{}

/**
 *	fw_caps_to_lmm - translate Firmware to ethtool Link Mode Mask
 *	@port_type: Firmware Port Type
 *	@fw_caps: Firmware Port Capabilities
 *	@link_mode_mask: ethtool Link Mode Mask
 *
 *	Translate a Firmware Port Capabilities specification to an ethtool
 *	Link Mode Mask.
 */
static void fw_caps_to_lmm(enum fw_port_type port_type,
			   fw_port_cap32_t fw_caps,
			   unsigned long *link_mode_mask)
{}

/**
 *	lmm_to_fw_caps - translate ethtool Link Mode Mask to Firmware
 *	capabilities
 *	@link_mode_mask: ethtool Link Mode Mask
 *
 *	Translate ethtool Link Mode Mask into a Firmware Port capabilities
 *	value.
 */
static unsigned int lmm_to_fw_caps(const unsigned long *link_mode_mask)
{}

static int get_link_ksettings(struct net_device *dev,
			      struct ethtool_link_ksettings *link_ksettings)
{}

static int set_link_ksettings(struct net_device *dev,
			    const struct ethtool_link_ksettings *link_ksettings)
{}

/* Translate the Firmware FEC value into the ethtool value. */
static inline unsigned int fwcap_to_eth_fec(unsigned int fw_fec)
{}

/* Translate Common Code FEC value into ethtool value. */
static inline unsigned int cc_to_eth_fec(unsigned int cc_fec)
{}

/* Translate ethtool FEC value into Common Code value. */
static inline unsigned int eth_to_cc_fec(unsigned int eth_fec)
{}

static int get_fecparam(struct net_device *dev, struct ethtool_fecparam *fec)
{}

static int set_fecparam(struct net_device *dev, struct ethtool_fecparam *fec)
{}

static void get_pauseparam(struct net_device *dev,
			   struct ethtool_pauseparam *epause)
{}

static int set_pauseparam(struct net_device *dev,
			  struct ethtool_pauseparam *epause)
{}

static void get_sge_param(struct net_device *dev, struct ethtool_ringparam *e,
			  struct kernel_ethtool_ringparam *kernel_e,
			  struct netlink_ext_ack *extack)
{}

static int set_sge_param(struct net_device *dev, struct ethtool_ringparam *e,
			 struct kernel_ethtool_ringparam *kernel_e,
			 struct netlink_ext_ack *extack)
{}

/**
 * set_rx_intr_params - set a net devices's RX interrupt holdoff paramete!
 * @dev: the network device
 * @us: the hold-off time in us, or 0 to disable timer
 * @cnt: the hold-off packet count, or 0 to disable counter
 *
 * Set the RX interrupt hold-off parameters for a network device.
 */
static int set_rx_intr_params(struct net_device *dev,
			      unsigned int us, unsigned int cnt)
{}

static int set_adaptive_rx_setting(struct net_device *dev, int adaptive_rx)
{}

static int get_adaptive_rx_setting(struct net_device *dev)
{}

/* Return the current global Adapter SGE Doorbell Queue Timer Tick for all
 * Ethernet TX Queues.
 */
static int get_dbqtimer_tick(struct net_device *dev)
{}

/* Return the SGE Doorbell Queue Timer Value for the Ethernet TX Queues
 * associated with a Network Device.
 */
static int get_dbqtimer(struct net_device *dev)
{}

/* Set the global Adapter SGE Doorbell Queue Timer Tick for all Ethernet TX
 * Queues.  This is the fundamental "Tick" that sets the scale of values which
 * can be used.  Individual Ethernet TX Queues index into a relatively small
 * array of Tick Multipliers.  Changing the base Tick will thus change all of
 * the resulting Timer Values associated with those multipliers for all
 * Ethernet TX Queues.
 */
static int set_dbqtimer_tick(struct net_device *dev, int usecs)
{}

/* Set the SGE Doorbell Queue Timer Value for the Ethernet TX Queues
 * associated with a Network Device.  There is a relatively small array of
 * possible Timer Values so we need to pick the closest value available.
 */
static int set_dbqtimer(struct net_device *dev, int usecs)
{}

/* Set the global Adapter SGE Doorbell Queue Timer Tick for all Ethernet TX
 * Queues and the Timer Value for the Ethernet TX Queues associated with a
 * Network Device.  Since changing the global Tick changes all of the
 * available Timer Values, we need to do this first before selecting the
 * resulting closest Timer Value.  Moreover, since the Tick is global,
 * changing it affects the Timer Values for all Network Devices on the
 * adapter.  So, before changing the Tick, we grab all of the current Timer
 * Values for other Network Devices on this Adapter and then attempt to select
 * new Timer Values which are close to the old values ...
 */
static int set_dbqtimer_tickval(struct net_device *dev,
				int tick_usecs, int timer_usecs)
{}

static int set_coalesce(struct net_device *dev,
			struct ethtool_coalesce *coalesce,
			struct kernel_ethtool_coalesce *kernel_coal,
			struct netlink_ext_ack *extack)
{}

static int get_coalesce(struct net_device *dev, struct ethtool_coalesce *c,
			struct kernel_ethtool_coalesce *kernel_coal,
			struct netlink_ext_ack *extack)
{}

/* The next two routines implement eeprom read/write from physical addresses.
 */
static int eeprom_rd_phys(struct adapter *adap, unsigned int phys_addr, u32 *v)
{}

static int eeprom_wr_phys(struct adapter *adap, unsigned int phys_addr, u32 v)
{}

#define EEPROM_MAGIC

static int get_eeprom(struct net_device *dev, struct ethtool_eeprom *e,
		      u8 *data)
{}

static int set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
		      u8 *data)
{}

static int cxgb4_ethtool_flash_bootcfg(struct net_device *netdev,
				       const u8 *data, u32 size)
{}

static int cxgb4_ethtool_flash_boot(struct net_device *netdev,
				    const u8 *bdata, u32 size)
{}

#define CXGB4_PHY_SIG

static int cxgb4_validate_phy_image(const u8 *data, u32 *size)
{}

static int cxgb4_ethtool_flash_phy(struct net_device *netdev,
				   const u8 *data, u32 size)
{}

static int cxgb4_ethtool_flash_fw(struct net_device *netdev,
				  const u8 *data, u32 size)
{}

static int cxgb4_ethtool_flash_region(struct net_device *netdev,
				      const u8 *data, u32 size, u32 region)
{}

#define CXGB4_FW_SIG
#define CXGB4_FW_SIG_OFFSET

static int cxgb4_validate_fw_image(const u8 *data, u32 *size)
{}

static int cxgb4_validate_bootcfg_image(const u8 *data, u32 *size)
{}

static int cxgb4_validate_boot_image(const u8 *data, u32 *size)
{}

static int cxgb4_ethtool_get_flash_region(const u8 *data, u32 *size)
{}

static int set_flash(struct net_device *netdev, struct ethtool_flash *ef)
{}

static int get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *ts_info)
{}

static u32 get_rss_table_size(struct net_device *dev)
{}

static int get_rss_table(struct net_device *dev,
			 struct ethtool_rxfh_param *rxfh)
{}

static int set_rss_table(struct net_device *dev,
			 struct ethtool_rxfh_param *rxfh,
			 struct netlink_ext_ack *extack)
{}

static struct filter_entry *cxgb4_get_filter_entry(struct adapter *adap,
						   u32 ftid)
{}

static void cxgb4_fill_filter_rule(struct ethtool_rx_flow_spec *fs,
				   struct ch_filter_specification *dfs)
{}

static int cxgb4_ntuple_get_filter(struct net_device *dev,
				   struct ethtool_rxnfc *cmd,
				   unsigned int loc)
{}

static int get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info,
		     u32 *rules)
{}

static int cxgb4_ntuple_del_filter(struct net_device *dev,
				   struct ethtool_rxnfc *cmd)
{}

/* Add Ethtool n-tuple filters. */
static int cxgb4_ntuple_set_filter(struct net_device *netdev,
				   struct ethtool_rxnfc *cmd)
{}

static int set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
{}

static int set_dump(struct net_device *dev, struct ethtool_dump *eth_dump)
{}

static int get_dump_flag(struct net_device *dev, struct ethtool_dump *eth_dump)
{}

static int get_dump_data(struct net_device *dev, struct ethtool_dump *eth_dump,
			 void *buf)
{}

static bool cxgb4_fw_mod_type_info_available(unsigned int fw_mod_type)
{}

static int cxgb4_get_module_info(struct net_device *dev,
				 struct ethtool_modinfo *modinfo)
{}

static int cxgb4_get_module_eeprom(struct net_device *dev,
				   struct ethtool_eeprom *eprom, u8 *data)
{}

static u32 cxgb4_get_priv_flags(struct net_device *netdev)
{}

/**
 *	set_flags - set/unset specified flags if passed in new_flags
 *	@cur_flags: pointer to current flags
 *	@new_flags: new incoming flags
 *	@flags: set of flags to set/unset
 */
static inline void set_flags(u32 *cur_flags, u32 new_flags, u32 flags)
{}

static int cxgb4_set_priv_flags(struct net_device *netdev, u32 flags)
{}

static void cxgb4_lb_test(struct net_device *netdev, u64 *lb_status)
{}

static void cxgb4_self_test(struct net_device *netdev,
			    struct ethtool_test *eth_test, u64 *data)
{}

static const struct ethtool_ops cxgb_ethtool_ops =;

void cxgb4_cleanup_ethtool_filters(struct adapter *adap)
{}

int cxgb4_init_ethtool_filters(struct adapter *adap)
{}

void cxgb4_set_ethtool_ops(struct net_device *netdev)
{}