From 74ebeae0b4c411df9900224b90a6072b16098458 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 19:34:36 +0200 Subject: Adding upstream version 1:6.7. Signed-off-by: Daniel Baumann --- vioc.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 vioc.c (limited to 'vioc.c') diff --git a/vioc.c b/vioc.c new file mode 100644 index 0000000..c04a6dc --- /dev/null +++ b/vioc.c @@ -0,0 +1,34 @@ +/* Copyright 2006 Fabric7 Systems, Inc */ + +#include +#include +#include "internal.h" + +struct regs_line { + u32 addr; + u32 data; +}; + +#define VIOC_REGS_LINE_SIZE sizeof(struct regs_line) + +int vioc_dump_regs(struct ethtool_drvinfo *info __maybe_unused, + struct ethtool_regs *regs) +{ + unsigned int i; + unsigned int num_regs; + struct regs_line *reg_info = (struct regs_line *) regs->data; + + printf("ethtool_regs\n" + "%-20s = %04x\n" + "%-20s = %04x\n", + "cmd", regs->cmd, + "version", regs->version); + + num_regs = regs->len/VIOC_REGS_LINE_SIZE; + + for (i = 0; i < num_regs; i++){ + printf("%08x = %08x\n", reg_info[i].addr, reg_info[i].data); + } + + return 0; +} -- cgit v1.2.3