• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright 2006 Fabric7 Systems, Inc */
2 
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include "internal.h"
6 
7 struct regs_line {
8 		u32	addr;
9 		u32	data;
10 };
11 
12 #define VIOC_REGS_LINE_SIZE	sizeof(struct regs_line)
13 
vioc_dump_regs(struct ethtool_drvinfo * info maybe_unused,struct ethtool_regs * regs)14 int vioc_dump_regs(struct ethtool_drvinfo *info maybe_unused,
15 		   struct ethtool_regs *regs)
16 {
17 	unsigned int	i;
18 	unsigned int	num_regs;
19 	struct regs_line *reg_info = (struct regs_line *) regs->data;
20 
21 	printf("ethtool_regs\n"
22 		"%-20s = %04x\n"
23 		"%-20s = %04x\n",
24 		"cmd", regs->cmd,
25 		"version", regs->version);
26 
27 	num_regs = regs->len/VIOC_REGS_LINE_SIZE;
28 
29 	for (i = 0; i < num_regs; i++){
30 		printf("%08x = %08x\n", reg_info[i].addr, reg_info[i].data);
31 	}
32 
33 	return 0;
34 }
35