ethtool.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * ethtool.h: Defines for Linux ethtool.
  4. *
  5. * Copyright (C) 1998 David S. Miller ([email protected])
  6. * Copyright 2001 Jeff Garzik <[email protected]>
  7. * Portions Copyright 2001 Sun Microsystems ([email protected])
  8. * Portions Copyright 2002 Intel ([email protected],
  9. * [email protected],
  10. * [email protected])
  11. * Portions Copyright (C) Sun Microsystems 2008
  12. */
  13. #ifndef _UAPI_LINUX_ETHTOOL_H
  14. #define _UAPI_LINUX_ETHTOOL_H
  15. #include <linux/kernel.h>
  16. #include <linux/types.h>
  17. #include <linux/if_ether.h>
  18. #define ETHTOOL_GCHANNELS 0x0000003c /* Get no of channels */
  19. /**
  20. * struct ethtool_channels - configuring number of network channel
  21. * @cmd: ETHTOOL_{G,S}CHANNELS
  22. * @max_rx: Read only. Maximum number of receive channel the driver support.
  23. * @max_tx: Read only. Maximum number of transmit channel the driver support.
  24. * @max_other: Read only. Maximum number of other channel the driver support.
  25. * @max_combined: Read only. Maximum number of combined channel the driver
  26. * support. Set of queues RX, TX or other.
  27. * @rx_count: Valid values are in the range 1 to the max_rx.
  28. * @tx_count: Valid values are in the range 1 to the max_tx.
  29. * @other_count: Valid values are in the range 1 to the max_other.
  30. * @combined_count: Valid values are in the range 1 to the max_combined.
  31. *
  32. * This can be used to configure RX, TX and other channels.
  33. */
  34. struct ethtool_channels {
  35. __u32 cmd;
  36. __u32 max_rx;
  37. __u32 max_tx;
  38. __u32 max_other;
  39. __u32 max_combined;
  40. __u32 rx_count;
  41. __u32 tx_count;
  42. __u32 other_count;
  43. __u32 combined_count;
  44. };
  45. #define ETHTOOL_FWVERS_LEN 32
  46. #define ETHTOOL_BUSINFO_LEN 32
  47. #define ETHTOOL_EROMVERS_LEN 32
  48. /**
  49. * struct ethtool_drvinfo - general driver and device information
  50. * @cmd: Command number = %ETHTOOL_GDRVINFO
  51. * @driver: Driver short name. This should normally match the name
  52. * in its bus driver structure (e.g. pci_driver::name). Must
  53. * not be an empty string.
  54. * @version: Driver version string; may be an empty string
  55. * @fw_version: Firmware version string; may be an empty string
  56. * @erom_version: Expansion ROM version string; may be an empty string
  57. * @bus_info: Device bus address. This should match the dev_name()
  58. * string for the underlying bus device, if there is one. May be
  59. * an empty string.
  60. * @reserved2: Reserved for future use; see the note on reserved space.
  61. * @n_priv_flags: Number of flags valid for %ETHTOOL_GPFLAGS and
  62. * %ETHTOOL_SPFLAGS commands; also the number of strings in the
  63. * %ETH_SS_PRIV_FLAGS set
  64. * @n_stats: Number of u64 statistics returned by the %ETHTOOL_GSTATS
  65. * command; also the number of strings in the %ETH_SS_STATS set
  66. * @testinfo_len: Number of results returned by the %ETHTOOL_TEST
  67. * command; also the number of strings in the %ETH_SS_TEST set
  68. * @eedump_len: Size of EEPROM accessible through the %ETHTOOL_GEEPROM
  69. * and %ETHTOOL_SEEPROM commands, in bytes
  70. * @regdump_len: Size of register dump returned by the %ETHTOOL_GREGS
  71. * command, in bytes
  72. *
  73. * Users can use the %ETHTOOL_GSSET_INFO command to get the number of
  74. * strings in any string set (from Linux 2.6.34).
  75. *
  76. * Drivers should set at most @driver, @version, @fw_version and
  77. * @bus_info in their get_drvinfo() implementation. The ethtool
  78. * core fills in the other fields using other driver operations.
  79. */
  80. struct ethtool_drvinfo {
  81. __u32 cmd;
  82. char driver[32];
  83. char version[32];
  84. char fw_version[ETHTOOL_FWVERS_LEN];
  85. char bus_info[ETHTOOL_BUSINFO_LEN];
  86. char erom_version[ETHTOOL_EROMVERS_LEN];
  87. char reserved2[12];
  88. __u32 n_priv_flags;
  89. __u32 n_stats;
  90. __u32 testinfo_len;
  91. __u32 eedump_len;
  92. __u32 regdump_len;
  93. };
  94. #define ETHTOOL_GDRVINFO 0x00000003
  95. #endif /* _UAPI_LINUX_ETHTOOL_H */