History

ethtool: Expand documentation of struct ethtool_drvinfo

Replace the inline comments (and some others below) with a full explanation of the semantics, in kernel-doc format. Specify which strings may be empty. Document the relationship with other commands. Replace the 'deprecation' of some fields with a proper explanation of the conversion to generalised string sets, as userland programs may not be able to assume that ETHTOOL_GSSET_INFO is available.

Ben Hutchings committed 12 years ago

Commit daba1b61 parent bf8fc601 file · +39 −17Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/ethtool.h+39−17
@@ -139,28 +139,50 @@ static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep) · 138 unmodified lines
139139
140140 #define ETHTOOL_FWVERS_LEN 32
141141 #define ETHTOOL_BUSINFO_LEN 32
142−/* these strings are set to whatever the driver author decides... */
142+
143+/**
144+ * struct ethtool_drvinfo - general driver and device information
145+ * @cmd: Command number = %ETHTOOL_GDRVINFO
146+ * @driver: Driver short name. This should normally match the name
147+ * in its bus driver structure (e.g. pci_driver::name). Must
148+ * not be an empty string.
149+ * @version: Driver version string; may be an empty string
150+ * @fw_version: Firmware version string; may be an empty string
151+ * @bus_info: Device bus address. This should match the dev_name()
152+ * string for the underlying bus device, if there is one. May be
153+ * an empty string.
154+ * @n_priv_flags: Number of flags valid for %ETHTOOL_GPFLAGS and
155+ * %ETHTOOL_SPFLAGS commands; also the number of strings in the
156+ * %ETH_SS_PRIV_FLAGS set
157+ * @n_stats: Number of u64 statistics returned by the %ETHTOOL_GSTATS
158+ * command; also the number of strings in the %ETH_SS_STATS set
159+ * @testinfo_len: Number of results returned by the %ETHTOOL_TEST
160+ * command; also the number of strings in the %ETH_SS_TEST set
161+ * @eedump_len: Size of EEPROM accessible through the %ETHTOOL_GEEPROM
162+ * and %ETHTOOL_SEEPROM commands, in bytes
163+ * @regdump_len: Size of register dump returned by the %ETHTOOL_GREGS
164+ * command, in bytes
165+ *
166+ * Users can use the %ETHTOOL_GSSET_INFO command to get the number of
167+ * strings in any string set (from Linux 2.6.34).
168+ *
169+ * Drivers should set at most @driver, @version, @fw_version and
170+ * @bus_info in their get_drvinfo() implementation. The ethtool
171+ * core fills in the other fields using other driver operations.
172+ */
143173 struct ethtool_drvinfo {
144174 __u32 cmd;
145− char driver[32]; /* driver short name, "tulip", "eepro100" */
146− char version[32]; /* driver version string */
147− char fw_version[ETHTOOL_FWVERS_LEN]; /* firmware version string */
148− char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */
149− /* For PCI devices, use pci_name(pci_dev). */
175+ char driver[32];
176+ char version[32];
177+ char fw_version[ETHTOOL_FWVERS_LEN];
178+ char bus_info[ETHTOOL_BUSINFO_LEN];
150179 char reserved1[32];
151180 char reserved2[12];
152− /*
153− * Some struct members below are filled in
154− * using ops->get_sset_count(). Obtaining
155− * this info from ethtool_drvinfo is now
156− * deprecated; Use ETHTOOL_GSSET_INFO
157− * instead.
158− */
159− __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */
160− __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */
181+ __u32 n_priv_flags;
182+ __u32 n_stats;
161183 __u32 testinfo_len;
162− __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */
163− __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */
184+ __u32 eedump_len;
185+ __u32 regdump_len;
164186 };
165187
166188 #define SOPASS_MAX 6

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t