Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools: include: Add ethtool_drvinfo definition to UAPI header

Instead of copying the whole header in, just add the struct definitions
we need for now. In the future it can be synced as a copy of in-tree
header if required.

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210821002010.845777-3-memxor@gmail.com

authored by

Kumar Kartikeya Dwivedi and committed by
Alexei Starovoitov
f2e85d4a 50b796e6

+53
+53
tools/include/uapi/linux/ethtool.h
··· 48 48 __u32 combined_count; 49 49 }; 50 50 51 + #define ETHTOOL_FWVERS_LEN 32 52 + #define ETHTOOL_BUSINFO_LEN 32 53 + #define ETHTOOL_EROMVERS_LEN 32 54 + 55 + /** 56 + * struct ethtool_drvinfo - general driver and device information 57 + * @cmd: Command number = %ETHTOOL_GDRVINFO 58 + * @driver: Driver short name. This should normally match the name 59 + * in its bus driver structure (e.g. pci_driver::name). Must 60 + * not be an empty string. 61 + * @version: Driver version string; may be an empty string 62 + * @fw_version: Firmware version string; may be an empty string 63 + * @erom_version: Expansion ROM version string; may be an empty string 64 + * @bus_info: Device bus address. This should match the dev_name() 65 + * string for the underlying bus device, if there is one. May be 66 + * an empty string. 67 + * @reserved2: Reserved for future use; see the note on reserved space. 68 + * @n_priv_flags: Number of flags valid for %ETHTOOL_GPFLAGS and 69 + * %ETHTOOL_SPFLAGS commands; also the number of strings in the 70 + * %ETH_SS_PRIV_FLAGS set 71 + * @n_stats: Number of u64 statistics returned by the %ETHTOOL_GSTATS 72 + * command; also the number of strings in the %ETH_SS_STATS set 73 + * @testinfo_len: Number of results returned by the %ETHTOOL_TEST 74 + * command; also the number of strings in the %ETH_SS_TEST set 75 + * @eedump_len: Size of EEPROM accessible through the %ETHTOOL_GEEPROM 76 + * and %ETHTOOL_SEEPROM commands, in bytes 77 + * @regdump_len: Size of register dump returned by the %ETHTOOL_GREGS 78 + * command, in bytes 79 + * 80 + * Users can use the %ETHTOOL_GSSET_INFO command to get the number of 81 + * strings in any string set (from Linux 2.6.34). 82 + * 83 + * Drivers should set at most @driver, @version, @fw_version and 84 + * @bus_info in their get_drvinfo() implementation. The ethtool 85 + * core fills in the other fields using other driver operations. 86 + */ 87 + struct ethtool_drvinfo { 88 + __u32 cmd; 89 + char driver[32]; 90 + char version[32]; 91 + char fw_version[ETHTOOL_FWVERS_LEN]; 92 + char bus_info[ETHTOOL_BUSINFO_LEN]; 93 + char erom_version[ETHTOOL_EROMVERS_LEN]; 94 + char reserved2[12]; 95 + __u32 n_priv_flags; 96 + __u32 n_stats; 97 + __u32 testinfo_len; 98 + __u32 eedump_len; 99 + __u32 regdump_len; 100 + }; 101 + 102 + #define ETHTOOL_GDRVINFO 0x00000003 103 + 51 104 #endif /* _UAPI_LINUX_ETHTOOL_H */