mirror of
https://github.com/torvalds/linux.git
synced 2024-11-17 01:22:07 +00:00
d26078fe72
This patch implements all ethtool related entry point functions for the driver. - Changes in this submission - - Removed redundant #include statements - Changes in previous submissions - - Removed unused statistics. - General clean up - removed unused variables and macros. - Incorporated following comments from Ben Hutchings - No need to restart the interface in vxge_ethtool_sset - Do not use #ifdef ADVERTISED_XX - Remove unnecessart intermediate copy in vxge_ethtool_gdrvinfo - Use strlcpy() to ensure null-termination. - Use ethtool_op_get_tso, ethtool_op_set_tx_hw_csum instead of redefining the same code. - Implement get_strings_count instead of deprecated get_stats_count. - Don't report reporting the EEPROM length as we don't supprt get/set eeprom. - Don't set self_test_count as we don't support any self tests. Signed-off-by: Sivakumar Subramani <sivakumar.subramani@neterion.com> Signed-off-by: Rastapur Santosh <santosh.rastapur@neterion.com> Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com> Signed-off-by: David S. Miller <davem@davemloft.net>
68 lines
2.2 KiB
C
68 lines
2.2 KiB
C
/******************************************************************************
|
|
* This software may be used and distributed according to the terms of
|
|
* the GNU General Public License (GPL), incorporated herein by reference.
|
|
* Drivers based on or derived from this code fall under the GPL and must
|
|
* retain the authorship, copyright and license notice. This file is not
|
|
* a complete program and may only be used when the entire operating
|
|
* system is licensed under the GPL.
|
|
* See the file COPYING in this distribution for more information.
|
|
*
|
|
* vxge-ethtool.h: Driver for Neterion Inc's X3100 Series 10GbE PCIe I/O
|
|
* Virtualized Server Adapter.
|
|
* Copyright(c) 2002-2009 Neterion Inc.
|
|
******************************************************************************/
|
|
#ifndef _VXGE_ETHTOOL_H
|
|
#define _VXGE_ETHTOOL_H
|
|
|
|
#include "vxge-main.h"
|
|
|
|
/* Ethtool related variables and Macros. */
|
|
static int vxge_ethtool_get_sset_count(struct net_device *dev, int sset);
|
|
|
|
static char ethtool_driver_stats_keys[][ETH_GSTRING_LEN] = {
|
|
{"\n DRIVER STATISTICS"},
|
|
{"vpaths_opened"},
|
|
{"vpath_open_fail_cnt"},
|
|
{"link_up_cnt"},
|
|
{"link_down_cnt"},
|
|
{"tx_frms"},
|
|
{"tx_errors"},
|
|
{"tx_bytes"},
|
|
{"txd_not_free"},
|
|
{"txd_out_of_desc"},
|
|
{"rx_frms"},
|
|
{"rx_errors"},
|
|
{"rx_bytes"},
|
|
{"rx_mcast"},
|
|
{"pci_map_fail_cnt"},
|
|
{"skb_alloc_fail_cnt"}
|
|
};
|
|
|
|
#define VXGE_TITLE_LEN 5
|
|
#define VXGE_HW_VPATH_STATS_LEN 27
|
|
#define VXGE_HW_AGGR_STATS_LEN 13
|
|
#define VXGE_HW_PORT_STATS_LEN 94
|
|
#define VXGE_HW_VPATH_TX_STATS_LEN 19
|
|
#define VXGE_HW_VPATH_RX_STATS_LEN 42
|
|
#define VXGE_SW_STATS_LEN 60
|
|
#define VXGE_HW_STATS_LEN (VXGE_HW_VPATH_STATS_LEN +\
|
|
VXGE_HW_AGGR_STATS_LEN +\
|
|
VXGE_HW_PORT_STATS_LEN +\
|
|
VXGE_HW_VPATH_TX_STATS_LEN +\
|
|
VXGE_HW_VPATH_RX_STATS_LEN)
|
|
|
|
#define DRIVER_STAT_LEN (sizeof(ethtool_driver_stats_keys)/ETH_GSTRING_LEN)
|
|
#define STAT_LEN (VXGE_HW_STATS_LEN + DRIVER_STAT_LEN + VXGE_SW_STATS_LEN)
|
|
|
|
/* Maximum flicker time of adapter LED */
|
|
#define VXGE_MAX_FLICKER_TIME (60 * HZ) /* 60 seconds */
|
|
#define VXGE_FLICKER_ON 1
|
|
#define VXGE_FLICKER_OFF 0
|
|
|
|
#define vxge_add_string(fmt, size, buf, ...) {\
|
|
snprintf(buf + *size, ETH_GSTRING_LEN, fmt, __VA_ARGS__); \
|
|
*size += ETH_GSTRING_LEN; \
|
|
}
|
|
|
|
#endif /*_VXGE_ETHTOOL_H*/
|