vxge-ethtool.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 Exar Corp's X3100 Series 10GbE PCIe I/O
  11. * Virtualized Server Adapter.
  12. * Copyright(c) 2002-2010 Exar Corp.
  13. ******************************************************************************/
  14. #ifndef _VXGE_ETHTOOL_H
  15. #define _VXGE_ETHTOOL_H
  16. #include "vxge-main.h"
  17. /* Ethtool related variables and Macros. */
  18. static int vxge_ethtool_get_sset_count(struct net_device *dev, int sset);
  19. static char ethtool_driver_stats_keys[][ETH_GSTRING_LEN] = {
  20. {"\n DRIVER STATISTICS"},
  21. {"vpaths_opened"},
  22. {"vpath_open_fail_cnt"},
  23. {"link_up_cnt"},
  24. {"link_down_cnt"},
  25. {"tx_frms"},
  26. {"tx_errors"},
  27. {"tx_bytes"},
  28. {"txd_not_free"},
  29. {"txd_out_of_desc"},
  30. {"rx_frms"},
  31. {"rx_errors"},
  32. {"rx_bytes"},
  33. {"rx_mcast"},
  34. {"pci_map_fail_cnt"},
  35. {"skb_alloc_fail_cnt"}
  36. };
  37. #define VXGE_TITLE_LEN 5
  38. #define VXGE_HW_VPATH_STATS_LEN 27
  39. #define VXGE_HW_AGGR_STATS_LEN 13
  40. #define VXGE_HW_PORT_STATS_LEN 94
  41. #define VXGE_HW_VPATH_TX_STATS_LEN 19
  42. #define VXGE_HW_VPATH_RX_STATS_LEN 42
  43. #define VXGE_SW_STATS_LEN 60
  44. #define VXGE_HW_STATS_LEN (VXGE_HW_VPATH_STATS_LEN +\
  45. VXGE_HW_AGGR_STATS_LEN +\
  46. VXGE_HW_PORT_STATS_LEN +\
  47. VXGE_HW_VPATH_TX_STATS_LEN +\
  48. VXGE_HW_VPATH_RX_STATS_LEN)
  49. #define DRIVER_STAT_LEN (sizeof(ethtool_driver_stats_keys)/ETH_GSTRING_LEN)
  50. #define STAT_LEN (VXGE_HW_STATS_LEN + DRIVER_STAT_LEN + VXGE_SW_STATS_LEN)
  51. /* Maximum flicker time of adapter LED */
  52. #define VXGE_MAX_FLICKER_TIME (60 * HZ) /* 60 seconds */
  53. #define VXGE_FLICKER_ON 1
  54. #define VXGE_FLICKER_OFF 0
  55. #define vxge_add_string(fmt, size, buf, ...) {\
  56. snprintf(buf + *size, ETH_GSTRING_LEN, fmt, __VA_ARGS__); \
  57. *size += ETH_GSTRING_LEN; \
  58. }
  59. #endif /*_VXGE_ETHTOOL_H*/