File: tg3.c

package info (click to toggle)
ethtool 2-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 564 kB
  • ctags: 1,013
  • sloc: ansic: 5,144; sh: 791; makefile: 46
file content (23 lines) | stat: -rw-r--r-- 496 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;
}