blob: 97613e99ff61c614c11400e95f1ced76c836c7f3 [file] [log] [blame]
Jeff Garzik32c80372005-10-25 01:56:48 -04001#include <stdio.h>
2#include "ethtool-util.h"
3
4#define TG3_MAGIC 0x669955aa
5
6int
7tg3_dump_eeprom(struct ethtool_drvinfo *info, struct ethtool_eeprom *ee)
8{
9 int i;
10
11 if (ee->magic != TG3_MAGIC) {
12 fprintf(stderr, "Magic number 0x%08x does not match 0x%08x\n",
13 ee->magic, TG3_MAGIC);
14 return -1;
15 }
16
17 fprintf(stdout, "Address \tData\n");
18 fprintf(stdout, "----------\t----\n");
19 for (i = 0; i < ee->len; i++)
20 fprintf(stdout, "0x%08x\t0x%02x\n", i + ee->offset, ee->data[i]);
21
22 return 0;
23}