summaryrefslogtreecommitdiff
path: root/ethtool.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-10-23 10:58:37 -0700
committerJeff Garzik <jeff@garzik.org>2007-02-09 16:28:37 -0500
commit5ab06db9d8777aef9307357b49d94cc267ba8105 (patch)
treeebb01efe517793180ddae93bb8185a653caad3e7 /ethtool.c
parentfd3dc7be2449dc1b7950fcf22dbc2cf5a6504fa2 (diff)
downloadethtool-5ab06db9d8777aef9307357b49d94cc267ba8105.tar.gz
ethtool: allow force hex in register dump
Sometimes the device decode logic just gets in the way so add a "force hex" option to register dump. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'ethtool.c')
-rw-r--r--ethtool.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/ethtool.c b/ethtool.c
index c8935ce..ca8a757 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -255,6 +255,7 @@ static int msglvl_wanted = -1;
static int phys_id_time = 0;
static int gregs_changed = 0;
static int gregs_dump_raw = 0;
+static int gregs_dump_hex = 0;
static char *gregs_dump_file = NULL;
static int geeprom_changed = 0;
static int geeprom_dump_raw = 0;
@@ -285,6 +286,7 @@ struct cmdline_info {
static struct cmdline_info cmdline_gregs[] = {
{ "raw", CMDL_BOOL, &gregs_dump_raw, NULL },
+ { "hex", CMDL_BOOL, &gregs_dump_hex, NULL },
{ "file", CMDL_STR, &gregs_dump_file, NULL },
};
@@ -1001,10 +1003,11 @@ static int dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
fclose(f);
}
- for (i = 0; i < ARRAY_SIZE(driver_list); i++)
- if (!strncmp(driver_list[i].name, info->driver,
- ETHTOOL_BUSINFO_LEN))
- return driver_list[i].func(info, regs);
+ if (!gregs_dump_hex)
+ for (i = 0; i < ARRAY_SIZE(driver_list); i++)
+ if (!strncmp(driver_list[i].name, info->driver,
+ ETHTOOL_BUSINFO_LEN))
+ return driver_list[i].func(info, regs);
fprintf(stdout, "Offset\tValues\n");
fprintf(stdout, "--------\t-----");