summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2011-03-18 22:35:44 +0000
committerBen Hutchings <bhutchings@solarflare.com>2011-03-18 22:44:45 +0000
commitc5bcaca8807869ccdf2bf639cadd6107b64522dc (patch)
tree931512b2dd6cb6efb6b9d7057c1478da50f60fa8
parent423c656b22eccfe21a7700a388c8765d43136a05 (diff)
downloadethtool-c5bcaca8807869ccdf2bf639cadd6107b64522dc.tar.gz
ethtool: Report driver features described in struct ethtool_drvinfo
ETHTOOL_GDRVINFO fills out struct ethtool_drvinfo with the size of the data returned by various other operations. The size should be non-zero if and only if the driver implements that operation. Therefore, we can report whether the driver supports certain operations without actually trying them (which may be expensive and disruptive). Do this in dump_drvinfo() rather than adding a separation operation. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-rw-r--r--ethtool.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/ethtool.c b/ethtool.c
index e9cb2c9..32df0ee 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -1423,11 +1423,19 @@ static int dump_drvinfo(struct ethtool_drvinfo *info)
"driver: %s\n"
"version: %s\n"
"firmware-version: %s\n"
- "bus-info: %s\n",
+ "bus-info: %s\n"
+ "supports-statistics: %s\n"
+ "supports-test: %s\n"
+ "supports-eeprom-access: %s\n"
+ "supports-register-dump: %s\n",
info->driver,
info->version,
info->fw_version,
- info->bus_info);
+ info->bus_info,
+ info->n_stats ? "yes" : "no",
+ info->testinfo_len ? "yes" : "no",
+ info->eedump_len ? "yes" : "no",
+ info->regdump_len ? "yes" : "no");
return 0;
}