#include <linux/vmalloc.h>
#include <linux/netdevice.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/if_ether.h>
#include <linux/ethtool.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/pm_runtime.h>
#include <linux/highmem.h>
#include <linux/mdio.h>
#include "igb.h"
struct igb_stats { … };
#define IGB_STAT(_name, _stat) …
static const struct igb_stats igb_gstrings_stats[] = …;
#define IGB_NETDEV_STAT(_net_stat) …
static const struct igb_stats igb_gstrings_net_stats[] = …;
#define IGB_GLOBAL_STATS_LEN …
#define IGB_NETDEV_STATS_LEN …
#define IGB_RX_QUEUE_STATS_LEN …
#define IGB_TX_QUEUE_STATS_LEN …
#define IGB_QUEUE_STATS_LEN …
#define IGB_STATS_LEN …
enum igb_diagnostics_results { … };
static const char igb_gstrings_test[][ETH_GSTRING_LEN] = …;
#define IGB_TEST_LEN …
static const char igb_priv_flags_strings[][ETH_GSTRING_LEN] = …;
#define IGB_PRIV_FLAGS_STR_LEN …
static int igb_get_link_ksettings(struct net_device *netdev,
struct ethtool_link_ksettings *cmd)
{ … }
static int igb_set_link_ksettings(struct net_device *netdev,
const struct ethtool_link_ksettings *cmd)
{ … }
static u32 igb_get_link(struct net_device *netdev)
{ … }
static void igb_get_pauseparam(struct net_device *netdev,
struct ethtool_pauseparam *pause)
{ … }
static int igb_set_pauseparam(struct net_device *netdev,
struct ethtool_pauseparam *pause)
{ … }
static u32 igb_get_msglevel(struct net_device *netdev)
{ … }
static void igb_set_msglevel(struct net_device *netdev, u32 data)
{ … }
static int igb_get_regs_len(struct net_device *netdev)
{ … }
static void igb_get_regs(struct net_device *netdev,
struct ethtool_regs *regs, void *p)
{ … }
static int igb_get_eeprom_len(struct net_device *netdev)
{ … }
static int igb_get_eeprom(struct net_device *netdev,
struct ethtool_eeprom *eeprom, u8 *bytes)
{ … }
static int igb_set_eeprom(struct net_device *netdev,
struct ethtool_eeprom *eeprom, u8 *bytes)
{ … }
static void igb_get_drvinfo(struct net_device *netdev,
struct ethtool_drvinfo *drvinfo)
{ … }
static void igb_get_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ring,
struct kernel_ethtool_ringparam *kernel_ring,
struct netlink_ext_ack *extack)
{ … }
static int igb_set_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ring,
struct kernel_ethtool_ringparam *kernel_ring,
struct netlink_ext_ack *extack)
{ … }
struct igb_reg_test { … };
#define PATTERN_TEST …
#define SET_READ_TEST …
#define WRITE_NO_TEST …
#define TABLE32_TEST …
#define TABLE64_TEST_LO …
#define TABLE64_TEST_HI …
static struct igb_reg_test reg_test_i210[] = …;
static struct igb_reg_test reg_test_i350[] = …;
static struct igb_reg_test reg_test_82580[] = …;
static struct igb_reg_test reg_test_82576[] = …;
static struct igb_reg_test reg_test_82575[] = …;
static bool reg_pattern_test(struct igb_adapter *adapter, u64 *data,
int reg, u32 mask, u32 write)
{ … }
static bool reg_set_and_check(struct igb_adapter *adapter, u64 *data,
int reg, u32 mask, u32 write)
{ … }
#define REG_PATTERN_TEST(reg, mask, write) …
#define REG_SET_AND_CHECK(reg, mask, write) …
static int igb_reg_test(struct igb_adapter *adapter, u64 *data)
{ … }
static int igb_eeprom_test(struct igb_adapter *adapter, u64 *data)
{ … }
static irqreturn_t igb_test_intr(int irq, void *data)
{ … }
static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
{ … }
static void igb_free_desc_rings(struct igb_adapter *adapter)
{ … }
static int igb_setup_desc_rings(struct igb_adapter *adapter)
{ … }
static void igb_phy_disable_receiver(struct igb_adapter *adapter)
{ … }
static int igb_integrated_phy_loopback(struct igb_adapter *adapter)
{ … }
static int igb_set_phy_loopback(struct igb_adapter *adapter)
{ … }
static int igb_setup_loopback_test(struct igb_adapter *adapter)
{ … }
static void igb_loopback_cleanup(struct igb_adapter *adapter)
{ … }
static void igb_create_lbtest_frame(struct sk_buff *skb,
unsigned int frame_size)
{ … }
static int igb_check_lbtest_frame(struct igb_rx_buffer *rx_buffer,
unsigned int frame_size)
{ … }
static int igb_clean_test_rings(struct igb_ring *rx_ring,
struct igb_ring *tx_ring,
unsigned int size)
{ … }
static int igb_run_loopback_test(struct igb_adapter *adapter)
{ … }
static int igb_loopback_test(struct igb_adapter *adapter, u64 *data)
{ … }
static int igb_link_test(struct igb_adapter *adapter, u64 *data)
{ … }
static void igb_diag_test(struct net_device *netdev,
struct ethtool_test *eth_test, u64 *data)
{ … }
static void igb_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
{ … }
static int igb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
{ … }
#define IGB_LED_ON …
static int igb_set_phys_id(struct net_device *netdev,
enum ethtool_phys_id_state state)
{ … }
static int igb_set_coalesce(struct net_device *netdev,
struct ethtool_coalesce *ec,
struct kernel_ethtool_coalesce *kernel_coal,
struct netlink_ext_ack *extack)
{ … }
static int igb_get_coalesce(struct net_device *netdev,
struct ethtool_coalesce *ec,
struct kernel_ethtool_coalesce *kernel_coal,
struct netlink_ext_ack *extack)
{ … }
static int igb_nway_reset(struct net_device *netdev)
{ … }
static int igb_get_sset_count(struct net_device *netdev, int sset)
{ … }
static void igb_get_ethtool_stats(struct net_device *netdev,
struct ethtool_stats *stats, u64 *data)
{ … }
static void igb_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
{ … }
static int igb_get_ts_info(struct net_device *dev,
struct kernel_ethtool_ts_info *info)
{ … }
#define ETHER_TYPE_FULL_MASK …
static int igb_get_ethtool_nfc_entry(struct igb_adapter *adapter,
struct ethtool_rxnfc *cmd)
{ … }
static int igb_get_ethtool_nfc_all(struct igb_adapter *adapter,
struct ethtool_rxnfc *cmd,
u32 *rule_locs)
{ … }
static int igb_get_rss_hash_opts(struct igb_adapter *adapter,
struct ethtool_rxnfc *cmd)
{ … }
static int igb_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
u32 *rule_locs)
{ … }
#define UDP_RSS_FLAGS …
static int igb_set_rss_hash_opt(struct igb_adapter *adapter,
struct ethtool_rxnfc *nfc)
{ … }
static int igb_rxnfc_write_etype_filter(struct igb_adapter *adapter,
struct igb_nfc_filter *input)
{ … }
static int igb_rxnfc_write_vlan_prio_filter(struct igb_adapter *adapter,
struct igb_nfc_filter *input)
{ … }
int igb_add_filter(struct igb_adapter *adapter, struct igb_nfc_filter *input)
{ … }
static void igb_clear_etype_filter_regs(struct igb_adapter *adapter,
u16 reg_index)
{ … }
static void igb_clear_vlan_prio_filter(struct igb_adapter *adapter,
u16 vlan_tci)
{ … }
int igb_erase_filter(struct igb_adapter *adapter, struct igb_nfc_filter *input)
{ … }
static int igb_update_ethtool_nfc_entry(struct igb_adapter *adapter,
struct igb_nfc_filter *input,
u16 sw_idx)
{ … }
static int igb_add_ethtool_nfc_entry(struct igb_adapter *adapter,
struct ethtool_rxnfc *cmd)
{ … }
static int igb_del_ethtool_nfc_entry(struct igb_adapter *adapter,
struct ethtool_rxnfc *cmd)
{ … }
static int igb_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
{ … }
static int igb_get_eee(struct net_device *netdev, struct ethtool_keee *edata)
{ … }
static int igb_set_eee(struct net_device *netdev,
struct ethtool_keee *edata)
{ … }
static int igb_get_module_info(struct net_device *netdev,
struct ethtool_modinfo *modinfo)
{ … }
static int igb_get_module_eeprom(struct net_device *netdev,
struct ethtool_eeprom *ee, u8 *data)
{ … }
static u32 igb_get_rxfh_indir_size(struct net_device *netdev)
{ … }
static int igb_get_rxfh(struct net_device *netdev,
struct ethtool_rxfh_param *rxfh)
{ … }
void igb_write_rss_indir_tbl(struct igb_adapter *adapter)
{ … }
static int igb_set_rxfh(struct net_device *netdev,
struct ethtool_rxfh_param *rxfh,
struct netlink_ext_ack *extack)
{ … }
static unsigned int igb_max_channels(struct igb_adapter *adapter)
{ … }
static void igb_get_channels(struct net_device *netdev,
struct ethtool_channels *ch)
{ … }
static int igb_set_channels(struct net_device *netdev,
struct ethtool_channels *ch)
{ … }
static u32 igb_get_priv_flags(struct net_device *netdev)
{ … }
static int igb_set_priv_flags(struct net_device *netdev, u32 priv_flags)
{ … }
static const struct ethtool_ops igb_ethtool_ops = …;
void igb_set_ethtool_ops(struct net_device *netdev)
{ … }