/*
* Copyright (C) 2013-2015 Chelsio Communications. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
*/
#include <linux/firmware.h>
#include <linux/mdio.h>
#include "cxgb4.h"
#include "t4_regs.h"
#include "t4fw_api.h"
#define EEPROM_MAGIC 0x38E2F10C
static u32 get_msglevel(struct net_device *dev)
{
return netdev2adap(dev)->msg_enable;
}
static void set_msglevel(struct net_device *dev, u32 val)
{
netdev2adap(dev)->msg_enable = val;
}
static const char stats_strings[][ETH_GSTRING_LEN] = {
"tx_octets_ok ",
"tx_frames_ok ",
"tx_broadcast_frames ",
"tx_multicast_frames ",
"tx_unicast_frames ",
"tx_error_frames ",
"tx_frames_64 ",
"tx_frames_65_to_127 ",
"tx_frames_128_to_255 ",
"tx_frames_256_to_511 ",
"tx_frames_512_to_1023 ",
"tx_frames_1024_to_1518 ",
"tx_frames_1519_to_max ",
"tx_frames_dropped ",
"tx_pause_frames ",
"tx_ppp0_frames ",
"tx_ppp1_frames ",
"tx_ppp2_frames ",
"tx_ppp3_frames ",
"tx_ppp4_frames ",
"tx_ppp5_frames ",
"tx_ppp6_frames ",
"tx_ppp7_frames ",
"rx_octets_ok ",
"rx_frames_ok ",
"rx_broadcast_frames ",
"rx_multicast_frames ",
"rx_unicast_frames ",
"rx_frames_too_long ",
"rx_jabber_errors ",
"rx_fcs_errors ",
"rx_length_errors ",
"rx_symbol_errors ",
"rx_runt_frames ",
"rx_frames_64 ",
"rx_frames_65_to_127 ",
"rx_frames_128_to_255 ",
"rx_frames_256_to_511 ",
"rx_frames_512_to_1023 ",
"rx_frames_1024_to_1518 ",
"rx_frames_1519_to_max ",
"rx_pause_frames ",
"rx_ppp0_frames ",
"rx_ppp1_frames ",
"rx_ppp2_frames ",
"rx_ppp3_frames ",
"rx_ppp4_frames ",
"rx_ppp5_frames ",
"rx_ppp6_frames ",
"rx_ppp7_frames ",
"rx_bg0_frames_dropped ",
"rx_bg1_frames_dropped ",
"rx_bg2_frames_dropped ",
"rx_bg3_frames_dropped ",
"rx_bg0_frames_trunc ",
"rx_bg1_frames_trunc ",
"rx_bg2_frames_trunc ",
"rx_bg3_frames_trunc ",
"tso ",
"tx_csum_offload ",
"rx_csum_good ",
"vlan_extractions ",
"vlan_insertions ",
"gro_packets ",
"gro_merged ",
};
static char adapter_stats_strings[][ETH_GSTRING_LEN] = {
"db_drop ",
"db_full ",
"db_empty ",
"tcp_ipv4_out_rsts ",
"tcp_ipv4_in_segs ",
"tcp_ipv4_out_segs ",
"tcp_ipv4_retrans_segs ",
"tcp_ipv6_out_rsts ",
"tcp_ipv6_in_segs ",
"tcp_ipv6_out_segs ",
"tcp_ipv6_retrans_segs ",
"usm_ddp_frames ",
"usm_ddp_octets ",
"usm_ddp_drops ",
"rdma_no_rqe_mod_defer ",
"rdma_no_rqe_pkt_defer ",
"tp_err_ofld_no_neigh ",
"tp_err_ofld_cong_defer ",
"write_coal_success ",
"write_coal_fail ",
};
static char channel_stats_strings[][ETH_GSTRING_LEN] = {
"--------Channel--------- ",
"tp_cpl_requests ",
"tp_cpl_responses ",
"tp_mac_in_errs ",
"tp_hdr_in_errs ",
"tp_tcp_in_errs ",
"tp_tcp6_in_errs ",
"tp_tnl_cong_drops ",
"tp_tnl_tx_drops ",
"tp_ofld_vlan_drops ",
"tp_ofld_chan_drops ",
"fcoe_octets_ddp ",
"fcoe_frames_ddp ",
"fcoe_frames_drop ",
};
static char loopback_stats_strings[][ETH_GSTRING_LEN] = {
"-------Loopback----------- ",
"octets_ok ",
"frames_ok ",
"bcast_frames ",
"mcast_frames ",
"ucast_frames ",
"error_frames ",
"frames_64 ",
"frames_65_to_127 ",
"frames_128_to_255 ",
"frames_256_to_511 ",
"frames_512_to_1023 ",
"frames_1024_to_1518 ",
"frames_1519_to_max ",
"frames_dropped ",
"bg0_frames_dropped ",
"bg1_frames_dropped ",
"bg2_frames_dropped ",
"bg3_frames_dropped ",
"bg0_frames_trunc ",
"bg1_frames_trunc ",
"bg2_frames_trunc ",
"bg3_frames_trunc ",
};
static int get_sset_count(struct net_device *dev