From c5bcaca8807869ccdf2bf639cadd6107b64522dc Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 18 Mar 2011 22:35:44 +0000 Subject: 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 --- ethtool.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'ethtool.c') 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; } -- cgit v1.2.1