| Jeff Garzik | 32c8037 | 2005-10-25 01:56:48 -0400 | [diff] [blame^] | 1 | #include <stdio.h> |
| 2 | #include "ethtool-util.h" |
| 3 | |
| 4 | #define TG3_MAGIC 0x669955aa |
| 5 | |
| 6 | int |
| 7 | tg3_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 | } |