#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)
{ … }
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)
{ … }
static int from_fw_port_mod_type(enum fw_port_type port_type,
enum fw_port_module_type mod_type)
{ … }
static unsigned int speed_to_fw_caps(int speed)
{ … }
static void fw_caps_to_lmm(enum fw_port_type port_type,
fw_port_cap32_t fw_caps,
unsigned long *link_mode_mask)
{ … }
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)
{ … }
static inline unsigned int fwcap_to_eth_fec(unsigned int fw_fec)
{ … }
static inline unsigned int cc_to_eth_fec(unsigned int cc_fec)
{ … }
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)
{ … }
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)
{ … }
static int get_dbqtimer_tick(struct net_device *dev)
{ … }
static int get_dbqtimer(struct net_device *dev)
{ … }
static int set_dbqtimer_tick(struct net_device *dev, int usecs)
{ … }
static int set_dbqtimer(struct net_device *dev, int usecs)
{ … }
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)
{ … }
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)
{ … }
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)
{ … }
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)
{ … }