summaryrefslogtreecommitdiff
path: root/tg3.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-10-25 01:56:48 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-10-25 01:56:48 -0400
commit32c8037055f5fdaba9c9f401fd532c02571b66d7 (patch)
tree9bfb9a987fc4a1046530bcac0cb9245c1b3db3ba /tg3.c
downloadethtool-32c8037055f5fdaba9c9f401fd532c02571b66d7.tar.gz
Initial import of ethtool version 3 + a few patches.
Diffstat (limited to 'tg3.c')
-rw-r--r--tg3.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/tg3.c b/tg3.c
new file mode 100644
index 0000000..97613e9
--- /dev/null
+++ b/tg3.c
@@ -0,0 +1,23 @@
+#include <stdio.h>
+#include "ethtool-util.h"
+
+#define TG3_MAGIC 0x669955aa
+
+int
+tg3_dump_eeprom(struct ethtool_drvinfo *info, struct ethtool_eeprom *ee)
+{
+ int i;
+
+ if (ee->magic != TG3_MAGIC) {
+ fprintf(stderr, "Magic number 0x%08x does not match 0x%08x\n",
+ ee->magic, TG3_MAGIC);
+ return -1;
+ }
+
+ fprintf(stdout, "Address \tData\n");
+ fprintf(stdout, "----------\t----\n");
+ for (i = 0; i < ee->len; i++)
+ fprintf(stdout, "0x%08x\t0x%02x\n", i + ee->offset, ee->data[i]);
+
+ return 0;
+}