diff options
author | Ramkrishna Vepa <ram.vepa@neterion.com> | 2009-04-01 14:15:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-02 03:33:44 -0400 |
commit | d26078fe7276e9de4eed7f3edcab41a2e8a045c8 (patch) | |
tree | f06ebbe3be5a92a91f66e0236324666d799ed73a /drivers/net/vxge/vxge-ethtool.h | |
parent | 703da5a1a231d8e3da8c7f88a505a4024941193b (diff) |
Neterion: New driver: Ethtool related
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>
Diffstat (limited to 'drivers/net/vxge/vxge-ethtool.h')
-rw-r--r-- | drivers/net/vxge/vxge-ethtool.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/drivers/net/vxge/vxge-ethtool.h b/drivers/net/vxge/vxge-ethtool.h new file mode 100644 index 000000000000..1c3df0a34acc --- /dev/null +++ b/drivers/net/vxge/vxge-ethtool.h | |||
@@ -0,0 +1,67 @@ | |||
1 | /****************************************************************************** | ||
2 | * This software may be used and distributed according to the terms of | ||
3 | * the GNU General Public License (GPL), incorporated herein by reference. | ||
4 | * Drivers based on or derived from this code fall under the GPL and must | ||
5 | * retain the authorship, copyright and license notice. This file is not | ||
6 | * a complete program and may only be used when the entire operating | ||
7 | * system is licensed under the GPL. | ||
8 | * See the file COPYING in this distribution for more information. | ||
9 | * | ||
10 | * vxge-ethtool.h: Driver for Neterion Inc's X3100 Series 10GbE PCIe I/O | ||
11 | * Virtualized Server Adapter. | ||
12 | * Copyright(c) 2002-2009 Neterion Inc. | ||
13 | ******************************************************************************/ | ||
14 | #ifndef _VXGE_ETHTOOL_H | ||
15 | #define _VXGE_ETHTOOL_H | ||
16 | |||
17 | #include "vxge-main.h" | ||
18 | |||
19 | /* Ethtool related variables and Macros. */ | ||
20 | static int vxge_ethtool_get_sset_count(struct net_device *dev, int sset); | ||
21 | |||
22 | static char ethtool_driver_stats_keys[][ETH_GSTRING_LEN] = { | ||
23 | {"\n DRIVER STATISTICS"}, | ||
24 | {"vpaths_opened"}, | ||
25 | {"vpath_open_fail_cnt"}, | ||
26 | {"link_up_cnt"}, | ||
27 | {"link_down_cnt"}, | ||
28 | {"tx_frms"}, | ||
29 | {"tx_errors"}, | ||
30 | {"tx_bytes"}, | ||
31 | {"txd_not_free"}, | ||
32 | {"txd_out_of_desc"}, | ||
33 | {"rx_frms"}, | ||
34 | {"rx_errors"}, | ||
35 | {"rx_bytes"}, | ||
36 | {"rx_mcast"}, | ||
37 | {"pci_map_fail_cnt"}, | ||
38 | {"skb_alloc_fail_cnt"} | ||
39 | }; | ||
40 | |||
41 | #define VXGE_TITLE_LEN 5 | ||
42 | #define VXGE_HW_VPATH_STATS_LEN 27 | ||
43 | #define VXGE_HW_AGGR_STATS_LEN 13 | ||
44 | #define VXGE_HW_PORT_STATS_LEN 94 | ||
45 | #define VXGE_HW_VPATH_TX_STATS_LEN 19 | ||
46 | #define VXGE_HW_VPATH_RX_STATS_LEN 42 | ||
47 | #define VXGE_SW_STATS_LEN 60 | ||
48 | #define VXGE_HW_STATS_LEN (VXGE_HW_VPATH_STATS_LEN +\ | ||
49 | VXGE_HW_AGGR_STATS_LEN +\ | ||
50 | VXGE_HW_PORT_STATS_LEN +\ | ||
51 | VXGE_HW_VPATH_TX_STATS_LEN +\ | ||
52 | VXGE_HW_VPATH_RX_STATS_LEN) | ||
53 | |||
54 | #define DRIVER_STAT_LEN (sizeof(ethtool_driver_stats_keys)/ETH_GSTRING_LEN) | ||
55 | #define STAT_LEN (VXGE_HW_STATS_LEN + DRIVER_STAT_LEN + VXGE_SW_STATS_LEN) | ||
56 | |||
57 | /* Maximum flicker time of adapter LED */ | ||
58 | #define VXGE_MAX_FLICKER_TIME (60 * HZ) /* 60 seconds */ | ||
59 | #define VXGE_FLICKER_ON 1 | ||
60 | #define VXGE_FLICKER_OFF 0 | ||
61 | |||
62 | #define vxge_add_string(fmt, size, buf, ...) {\ | ||
63 | snprintf(buf + *size, ETH_GSTRING_LEN, fmt, __VA_ARGS__); \ | ||
64 | *size += ETH_GSTRING_LEN; \ | ||
65 | } | ||
66 | |||
67 | #endif /*_VXGE_ETHTOOL_H*/ | ||