17
17
410 Severn Ave., Suite 210
20
Support and updates available at
21
http://www.scyld.com/diag/index.html
20
Updates and additional information are available at
21
http://www.scyld.com/diag/index.html
22
http://scyld.com/expert/mii-status.html
23
http://scyld.com/expert/NWay.html
25
Common-sense licensing statement: Using any portion of this program in
26
your own program means that you must give credit to the original author
27
and release the resulting code under the GPL. To use this code under
28
other terms requires an explicit license from the copyright holder.
24
31
3Com Vortex Engineering Release Specification
25
32
3Com Boomerang modifications (unreleased)
26
http://scyld.com/expert/mii-status.html
27
http://scyld.com/expert/NWay.html
28
http://www.national.com/pf/DP/DP83840.html
33
http://www.national.com/pf/DP/DP83840.html
31
36
static char *version_msg =
32
"vortex-diag.c:v2.05 5/15/2001 Donald Becker (becker@scyld.com)\n"
37
"vortex-diag.c:v2.14 12/28/2002 Donald Becker (becker@scyld.com)\n"
33
38
" http://www.scyld.com/diag/index.html\n";
34
39
static char *usage_msg =
35
"Usage: vortex-diag [-aDeEfFgGmpPqrRtvVwW] [-p <IOport>] [-[AF] <media>]\n"
40
"Usage: vortex-diag [-aDEefFgGhmPqrRtvVwW] [-p <IOport>] [-[AF] <media>]\n"
36
41
" For details and other options see http://www.scyld.com/diag/index.html\n";
43
static const char long_usage_msg[] =
44
"Usage: %s [-aDfrRvVw] [-AF <speed+duplex>] [-#<BoardNum>]\n"
46
" Show the internal state of a network adapter.\n"
48
" The common usage is\n"
51
" Frequently used options are\n"
52
" -a --show_all_registers Print all registers.\n"
53
" -e --show-eeprom Dump EEPROM contents, \"-ee\" shows the details.\n"
54
" -m --show_mii Print the MII transceiver state\n"
55
" Using -mm monitors the link.\n"
56
" -f --force Perform operation, even on a running NIC.\n"
58
" To operate on a single NIC, or one that hasn't been automatically found:\n"
59
" -# --card_num INDEX Operate on the specified card index.\n"
60
" -p --port-base IOADDR Assume an adapter at the specified I/O address.\n"
61
" -t --chip-type TYPE Specify adapter type with '-p', use '-1' to list.\n"
63
" To change the persistent EEPROM settings\n"
64
" -G --parameters PARMS Set adapter-specific parameters.\n"
65
" -H --new-hwaddr 01:23:45:67:ab:cd\n"
66
" Set a new hardware station address. Read the documentation first!\n"
67
" -w --write-EEPROM Actually write the new settings into the EEPROM.\n"
68
" To read and write the boot BIOS extension Flash ROM\n"
69
" -B Show the first few bytes of the ROM\n"
70
" -L FILE Load the Flash from FILE.\n"
71
" -S FILE Store the Flash image to FILE.\n"
74
" -v --verbose Report each action taken.\n"
75
" -V --version Emit version information.\n"
77
" -A --advertise <speed|setting> (See the mii-diag manual page.)\n"
38
80
#if ! defined(__OPTIMIZE__)
39
81
#warning You must compile this program with the correct options!
40
82
#warning See the last lines of the source file.
64
108
extern void (*flash_out_hook)(long addr, int offset, int val);
66
110
/* We should use __u8 .. __u32, but they are not always defined. */
67
typedef unsigned int u32;
68
typedef unsigned short u16;
69
typedef unsigned char u8;
111
typedef u_int32_t u32;
112
typedef u_int16_t u16;
71
115
struct option longopts[] = {
72
116
/* { name has_arg *flag val } */
117
{"card-num", 1, 0, '#'}, /* Operate on the specified card index. */
73
118
{"Advertise", 1, 0, 'A'},
74
119
{"base-address", 1, 0, 'p'},
75
120
{"show_all_registers", 0, 0, 'a'}, /* Print all registers. */
76
{"help", 0, 0, 'h'}, /* Give help */
77
{"show-eeprom", 0, 0, 'e'}, /* Dump EEPROM contents (-ee valid). */
121
{"help", 0, 0, 'h'}, /* Print a long usage message. */
122
{"show-eeprom", 0, 0, 'e'}, /* Dump EEPROM contents (-ee valid). */
78
123
{"emergency-rewrite", 0, 0, 'E'}, /* Re-write a corrupted EEPROM. */
79
124
{"force-detection", 0, 0, 'f'},
80
125
{"new-interface", 1, 0, 'F'}, /* New interface (built-in, AUI, etc.) */
109
158
{"3Com Generic Vortex/Boomerag/Cyclone", 0,
110
159
0x10B7, 0x9999, 0xffff, 0, 256, vortex_diag},
111
160
{"3Com 3c590 Vortex 10Mbps", "3Com Vortex (rev ",
112
0x10B7, 0x5900, 0xffff, 0, 256, vortex_diag},
161
0x10B7, 0x5900, 0xffff, 0, 32, vortex_diag},
113
162
{"3c592 EISA 10mbps Demon/Vortex", 0,
114
0x10B7, 0x5920, 0xffff, 0, 256, vortex_diag},
163
0x10B7, 0x5920, 0xffff, 0, 32, vortex_diag},
115
164
{"3Com 3c595 Vortex 10/100baseTx", "3Com Vortex (rev ",
116
0x10B7, 0x5950, 0xffff, 0, 256, vortex_diag},
165
0x10B7, 0x5950, 0xffff, 0, 32, vortex_diag},
117
166
{"3Com 3c595 Vortex 10/100baseT4", 0,
118
0x10B7, 0x5951, 0xffff, 0, 256, vortex_diag},
167
0x10B7, 0x5951, 0xffff, 0, 32, vortex_diag},
119
168
{"3Com 3c595 Vortex 10/100baseT-MII", 0,
120
0x10B7, 0x5952, 0xffff, 0, 256, vortex_diag},
169
0x10B7, 0x5952, 0xffff, 0, 32, vortex_diag},
121
170
{"3c597 EISA Fast Demon/Vortex", 0,
122
0x10B7, 0x5970, 0xffff, 0, 256, vortex_diag},
171
0x10B7, 0x5970, 0xffff, 0, 32, vortex_diag},
123
172
{"3c900 Boomerang 10baseT", "3Com 3C900",
124
0x10B7, 0x9000, 0xffff, 0, 256, vortex_diag},
173
0x10B7, 0x9000, 0xffff, 0, 64, vortex_diag},
125
174
{"3c900 Boomerang 10Mbps Combo", 0,
126
0x10B7, 0x9001, 0xffff, 0, 256, vortex_diag},
175
0x10B7, 0x9001, 0xffff, 0, 64, vortex_diag},
127
176
{"3c900 Cyclone 10Mbps TPO", 0,
128
0x10B7, 0x9004, 0xffff, 0, 256, vortex_diag},
177
0x10B7, 0x9004, 0xffff, IS_CYCLONE, 256, vortex_diag},
129
178
{"3c900 Cyclone 10Mbps Combo", 0,
130
0x10B7, 0x9005, 0xffff, 0, 256, vortex_diag},
179
0x10B7, 0x9005, 0xffff, IS_CYCLONE, 256, vortex_diag},
131
180
{"3c900 Cyclone 10Mbps TPC", 0,
132
0x10B7, 0x9006, 0xffff, 0, 256, vortex_diag},
181
0x10B7, 0x9006, 0xffff, IS_CYCLONE, 256, vortex_diag},
133
182
{"3c905 Boomerang 100baseTx", "3Com 3C905",
134
0x10B7, 0x9050, 0xffff, 0, 256, vortex_diag},
183
0x10B7, 0x9050, 0xffff, 0, 64, vortex_diag},
135
184
{"3c905 Boomerang 100baseT4", 0,
136
0x10B7, 0x9051, 0xffff, 0, 256, vortex_diag},
185
0x10B7, 0x9051, 0xffff, 0, 64, vortex_diag},
137
186
{"3c905B Cyclone 100baseTx", 0,
138
0x10B7, 0x9055, 0xffff, HAS_FLASH_BUG, 256, vortex_diag},
187
0x10B7, 0x9055, 0xffff, HAS_FLASH_BUG | IS_CYCLONE, 256, vortex_diag},
139
188
{"3c905B Cyclone 10/100/BNC", "3Com 3C905BNC",
140
0x10B7, 0x9058, 0xffff, HAS_FLASH_BUG, 256, vortex_diag},
189
0x10B7, 0x9058, 0xffff, HAS_FLASH_BUG | IS_CYCLONE, 256, vortex_diag},
141
190
{"3c905B Cyclone 100baseFx", "3Com 3C905B-FX",
142
0x10B7, 0x905A, 0xffff, HAS_FLASH_BUG, 256, vortex_diag},
191
0x10B7, 0x905A, 0xffff, HAS_FLASH_BUG | IS_CYCLONE, 256, vortex_diag},
143
192
{"3c905C Tornado 100baseTx", 0,
144
0x10B7, 0x9200, 0xff00, HAS_FLASH_BUG, 256, vortex_diag},
193
0x10B7, 0x9200, 0xff00, HAS_FLASH_BUG | IS_CYCLONE, 256, vortex_diag},
145
194
{"3c980 Cyclone, server edition", 0,
146
0x10B7, 0x9800, 0xffff, HAS_FLASH_BUG, 256, vortex_diag},
195
0x10B7, 0x9800, 0xffff, HAS_FLASH_BUG | IS_CYCLONE, 256, vortex_diag},
147
196
{"3c982 Dual Port server NIC", 0,
148
0x10B7, 0x9805, 0xffff, HAS_FLASH_BUG, 256, vortex_diag},
197
0x10B7, 0x9805, 0xffff, HAS_FLASH_BUG | IS_CYCLONE, 256, vortex_diag},
149
198
{"3c980 series, server edition", 0,
150
0x10B7, 0x9800, 0xfff0, HAS_FLASH_BUG, 256, vortex_diag},
199
0x10B7, 0x9800, 0xfff0, HAS_FLASH_BUG | IS_CYCLONE, 256, vortex_diag},
151
200
{"3Com 3cSOHO100-TX", 0,
152
0x10B7, 0x7646, 0xff00, HAS_FLASH_BUG, 256, vortex_diag},
201
0x10B7, 0x7646, 0xff00, HAS_FLASH_BUG | IS_CYCLONE, 256, vortex_diag},
153
202
{"3c450 HomePNA Cyclone", 0,
154
0x10B7, 0x4500, 0xffff, 0, 256, vortex_diag},
203
0x10B7, 0x4500, 0xffff, IS_CYCLONE, 256, vortex_diag},
155
204
{"3c555 Laptop Hurricane", 0,
156
205
0x10B7, 0x5055, 0xffff, HAS_FLASH_BUG, 256, vortex_diag},
157
206
{"3c556 Laptop Hurricane", 0,
161
210
{"3Com 3CCFE556", "3ccfe556 Roadrunner PCMCIA",
162
211
0x10B7, 0x0556, 0xffff, ROADRUNNER, 32, vortex_diag},
163
212
{"3c575 CardBus", 0,
164
0x10B7, 0x5057, 0xffff, HAS_FLASH_BUG, 32, vortex_diag},
213
0x10B7, 0x5057, 0xffff, HAS_FLASH_BUG | IS_CYCLONE, 32, vortex_diag},
165
214
{"3CCFE575BT CardBus", 0,
166
0x10B7, 0x5157, 0xffff, HAS_FLASH_BUG, 128, vortex_diag},
215
0x10B7, 0x5157, 0xffff, HAS_FLASH_BUG | IS_CYCLONE, 128, vortex_diag},
167
216
{"3CCFE575CT CardBus", 0,
168
0x10B7, 0x5257, 0xffff, HAS_FLASH_BUG, 128, vortex_diag},
217
0x10B7, 0x5257, 0xffff, HAS_FLASH_BUG | IS_CYCLONE, 128, vortex_diag},
169
218
{"3C575 CardBus (unknown version)", 0,
170
219
0x10B7, 0x5057, 0x0fff, HAS_FLASH_BUG, 32, vortex_diag},
171
220
{"3ccfe656 Cyclone CardBus", 0,
172
0x10B7, 0x6560, 0xffff, HAS_FLASH_BUG, 256, vortex_diag},
221
0x10B7, 0x6560, 0xffff, HAS_FLASH_BUG | IS_CYCLONE, 256, vortex_diag},
173
222
{"3Com 3CCFE656B Cyclone+WinModem CardBus", 0,
174
0x10B7, 0x6562, 0xffff, HAS_FLASH_BUG, 256, vortex_diag},
223
0x10B7, 0x6562, 0xffff, HAS_FLASH_BUG | IS_CYCLONE, 256, vortex_diag},
175
224
{"3Com 3CCFE656C Tornado CardBus", 0,
176
0x10B7, 0x6564, 0xffff, HAS_FLASH_BUG, 256, vortex_diag},
225
0x10B7, 0x6564, 0xffff, HAS_FLASH_BUG | IS_CYCLONE, 256, vortex_diag},
177
226
{"3Com 3CCFE656 Series", 0,
178
0x10B7, 0x6560, 0xfff0, HAS_FLASH_BUG, 256, vortex_diag},
227
0x10B7, 0x6560, 0xfff0, HAS_FLASH_BUG | IS_CYCLONE, 256, vortex_diag},
228
/* Added most new/unverified entries here. */
696
790
printf(" Configuration options %4.4x.\n",
697
791
inw(ioaddr + Wn2_ResetOptions));
699
/* Read the EEPROM. */
702
outw(0x5555, ioaddr + Wn0EepromData);
703
if (read_eeprom(ioaddr, 6, 0) != 0x5555) {
705
printf(" EEPROM Address length is 6 bits (%4.4x).\n",
706
read_eeprom(ioaddr, 6, 0));
709
int val = read_eeprom(ioaddr, 6, 0);
710
int e6 = read_eeprom(ioaddr, 6, 0);
711
int e8 = read_eeprom(ioaddr, 8, 0);
713
printf(" EEPROM address sizing read returned %4.4x/%4.4x/%4.4x.\n",
715
eeaddrlen = (e6 != 0xffff) ? 8 : 6;
717
eesize = 1 << eeaddrlen;
720
printf(" EEPROM address size is %d bits.\n", eeaddrlen);
721
for (i = 0; i < eesize; i++)
722
eeprom_contents[i] = read_eeprom(ioaddr, eeaddrlen, i);
724
if (eeprom_contents[0x37] == 0x6d50) {
725
ee_tbl_offset = 0x30;
726
} else if (eeprom_contents[0] == 0x10b7 || eeprom_contents[0] == 0x1570
727
|| eeprom_contents[0] == 0x2978) {
728
printf(" Questionable EEPROM offset for software information!\n");
729
ee_tbl_offset = 0x30;
732
unsigned short sum = 0;
733
memcpy(new_ee_contents, eeprom_contents, eesize << 1);
734
for (i = 0; i < 3; i++)
735
new_ee_contents[ee_tbl_offset + 10 + i] =
736
(new_hwaddr[i*2]<<8) + new_hwaddr[i*2+1];
737
/* Recalculate the checksum: Cyclone only! */
738
for (i = 0; i < 0x1A; i++)
739
sum ^= new_ee_contents[ee_tbl_offset + i];
740
new_ee_contents[ee_tbl_offset + 0x20] = (sum ^ (sum>>8)) & 0xff;
741
do_update(ioaddr, eeaddrlen, new_ee_contents, eeprom_contents);
742
for (i = 0; i < eesize; i++)
743
eeprom_contents[i] = read_eeprom(ioaddr, eeaddrlen, i);
747
unsigned short sum = 0;
748
memcpy(new_ee_contents, eeprom_contents, eesize << 1);
749
new_ee_contents[9] = 0x3001;
750
/* Recalculate the checksum: Cyclone only! */
751
for (i = 0; i < 0x1B; i++)
752
sum ^= new_ee_contents[i];
753
new_ee_contents[0x20] = (sum ^ (sum>>8)) & 0xff;
754
printf("Setting the EEPROM BIOS ROM field to %4.4x, new checksum "
755
"%2.2x.\n", new_ee_contents[9], new_ee_contents[0x20]);
756
do_update(ioaddr, eeaddrlen, new_ee_contents, eeprom_contents);
757
for (i = 0; i < eesize; i++)
758
eeprom_contents[i] = read_eeprom(ioaddr, eeaddrlen, i);
760
if (verbose + show_eeprom > 2) {
761
unsigned short sum = 0;
762
printf("EEPROM contents (%d words, offset %#x):",
763
eesize, ee_tbl_offset);
764
for (i = 0; i < eesize; i++) {
766
printf("\n 0x%3.3x:", i);
767
printf(" %4.4x", eeprom_contents[i]);
768
sum += eeprom_contents[i];
770
printf("\n The word-wide EEPROM checksum is %#4.4x.\n", sum);
773
/* The user will usually want to see the interpreted EEPROM contents. */
774
if (verbose > 1 || show_eeprom) {
775
parse_eeprom(eeprom_contents);
794
interpret_eeprom(ioaddr);
778
796
/* Show up to four (not just the on-board) PHYs. */
779
797
if (verbose > 1 || show_mii) {
1020
static void parse_eeprom(unsigned short *eeprom)
1022
unsigned char *p = (void *)eeprom; /* Assumes little-endian */
1026
printf("Saved EEPROM settings of a 3Com Vortex/Boomerang:\n");
1027
if (eeprom[0x37] == 0x6d50) {
1028
printf(" The CardBus product ID is %4.4x %4.4x.\n",
1029
eeprom[0], eeprom[1]);
1033
printf(" 3Com Node Address ");
1034
for (i = 0; i < 5; i++)
1035
printf("%2.2X:", p[i^1]);
1036
printf("%2.2X (used as a unique ID only).\n", p[i^1]);
1037
printf(" OEM Station address %2.2X", p[1 + 20]);
1038
for (i = 1; i < 6; i++)
1039
printf(":%2.2X", p[(i^1) + 20]);
1040
printf(" (used as the ethernet address).\n");
1041
/* The original 3Com layout did not consider post-Y2K production. */
1042
printf(" Device ID %4.4x, Manufacturer ID %4.4x.\n", ee[3], ee[7]);
1043
printf(" Manufacture date (MM/DD/YYYY) %d/%d/%d, division %c,"
1044
" product %c%c.\n", ((p[8]>>5) & 7) + ((p[9]<<3) & 8),
1045
p[8] & 31, (p[9]>>1) + ((p[9]>>1) < 95 ? 2000 : 1900),
1046
p[10], p[12], p[13]);
1048
printf(" A BIOS ROM of size %dKx8 is expected.\n",
1051
printf(" No BIOS ROM is present.\n");
1052
printf(" Transceiver selection: %s.\n",
1053
el_medianames[(ee[19] >> 4) & 15]);
1054
printf(" Options: %s duplex, link beat %s.\n",
1055
ee[13] & 0x8000 ? "force full" : "negotiated",
1056
ee[13] & 0x4000 ? "check disabled" : "required");
1058
int MediaOptions = ee[0x19];
1059
printf(" PCI Subsystem IDs: Vendor %4.4x Device %4.4x.\n",
1060
ee[0x17], ee[0x18]);
1061
for (i = 0; i < 8; i++)
1062
if (MediaOptions & 1<<i)
1063
printf(" %s", medias[i]);
1064
printf("%s.\n", (MediaOptions&0xE100)==0x0100 ? "10baseFL" : "");
1066
for (i = 0; i < 0x16; i++)
1068
printf(" Vortex format checksum is %scorrect (%2.2x vs. %2.2x).\n",
1069
((sum ^ (sum>>8)) & 0xff) == ee[0x17] ? "" : "in",
1070
(sum ^ (sum>>8)) & 0xff, ee[0x17]);
1071
for ( ; i < 0x1A; i++)
1074
printf(" Cyclone format checksum is %scorrect (%#2.2x vs. %#2.2x).\n",
1075
(sum & 0xff) == (ee[0x20] & 0xff) ? "" : "in",
1076
sum & 0xff, ee[0x20] & 0xff);
1077
for (sum = 0, i = 0; i < 0x20*2; i++)
1078
sum ^= ((unsigned char *)ee)[i];
1079
printf(" Hurricane format checksum is %scorrect (%#2.2x vs. %#2.2x).\n",
1080
sum == (ee[0x20] & 0xff) ? "" : "in",
1081
sum, ee[0x20] & 0xff);
1085
static void interpret_eeprom(long ioaddr)
1087
int eeaddrlen, eesize, ee_tbl_offset = 0;
1088
int e6, eeprom_update = 0;
1091
/* Read the EEPROM. */
1094
outw(0x5555, ioaddr + Wn0EepromData);
1095
e6 = read_eeprom(ioaddr, 6, 0);
1098
printf(" EEPROM Address length is 6 bits (%4.4x).\n",
1099
read_eeprom(ioaddr, 6, 0));
1102
int e8 = read_eeprom(ioaddr, 8, 0);
1104
printf(" EEPROM address sizing read returned %4.4x/%4.4x.\n",
1106
eeaddrlen = (e8 != 0xffff) ? 8 : 6;
1108
eesize = 1 << eeaddrlen;
1111
printf(" EEPROM address size is %d bits.\n", eeaddrlen);
1112
for (i = 0; i < eesize; i++)
1113
eeprom_contents[i] = read_eeprom(ioaddr, eeaddrlen, i);
1115
if (eeprom_contents[0x37] == 0x6d50) {
1116
ee_tbl_offset = 0x30;
1117
} else if (eeprom_contents[0] == 0x10b7 || eeprom_contents[0] == 0x1570
1118
|| eeprom_contents[0] == 0x2978) {
1119
printf(" Questionable EEPROM offset for software information!\n");
1120
ee_tbl_offset = 0x30;
1123
memcpy(new_ee_contents, eeprom_contents, eesize << 1);
1125
for (i = 0; i < 3; i++)
1126
new_ee_contents[ee_tbl_offset + 10 + i] =
1127
(new_hwaddr[i*2]<<8) + new_hwaddr[i*2+1];
1131
new_ee_contents[ee_tbl_offset + 9] = 0x3001;
1134
if (new_default_media >= 0) {
1135
new_ee_contents[ee_tbl_offset + 19] &= 0x00ff;
1136
new_ee_contents[ee_tbl_offset + 19] |= (new_default_media << 8);
1139
if (eeprom_update) {
1140
u16 *ee = eeprom_contents + ee_tbl_offset;
1141
unsigned short sum = 0;
1142
int sum_range = 0x1A, sum_location = 0x20;
1144
/* Recalculate the checksum:
1145
First find the checksum range and location. */
1146
for (i = 0; i < 0x16; i++)
1148
if (((sum ^ (sum>>8)) & 0xff) == ee[0x17]) {
1150
sum_location = 0x17;
1152
for ( ; i < 0x1A; i++)
1154
if (((sum ^ (sum>>8)) & 0xff) == (ee[0x20] & 0xff)) {
1156
sum_location = 0x20;
1158
for ( ; i < 0x20; i++)
1160
if (((sum ^ (sum>>8)) & 0xff) == (ee[0x20] & 0xff)) {
1162
sum_location = 0x20;
1165
for (i = 0; i < sum_range; i++)
1166
sum ^= new_ee_contents[ee_tbl_offset + i];
1167
new_ee_contents[ee_tbl_offset + sum_location] =
1168
(sum ^ (sum>>8)) & 0xff;
1169
do_update(ioaddr, eeaddrlen, new_ee_contents, eeprom_contents);
1170
for (i = 0; i < eesize; i++)
1171
eeprom_contents[i] = read_eeprom(ioaddr, eeaddrlen, i);
1174
if (verbose > 2 || show_eeprom > 1) {
1175
unsigned short sum = 0;
1176
int previous_row_same = 0;
1178
printf("EEPROM format %dx16, configuration table at offset %#x:\n",
1179
eesize, ee_tbl_offset);
1180
for (i = 0; i < eesize; i += 8) {
1182
if (i == 0 || /* Always show first row. */
1183
(memcmp(eeprom_contents+i, eeprom_contents+i - 8, 16) != 0)) {
1184
previous_row_same = 0;
1185
printf(" %#4.2x:", i);
1186
for (j = 0; j < 8; j++) {
1187
printf(" %4.4x", eeprom_contents[i + j]);
1188
sum += eeprom_contents[i + j];
1190
if (show_eeprom > 2) {
1192
for (j = 0; j < 8; j++) {
1193
int ew = eeprom_contents[i + j];
1195
isprint(ew & 0xff) ? ew & 0xff : '_',
1196
isprint(ew >> 8) ? ew >> 8 : '_' );
1200
} else if ( ! previous_row_same) {
1201
previous_row_same = 1;
1205
printf("\n The word-wide EEPROM checksum is %#4.4x.\n", sum);
1208
/* The user will usually want to see the interpreted EEPROM contents. */
1209
if (verbose > 1 || show_eeprom) {
1210
parse_eeprom(eeprom_contents);
1000
1217
/* Read and write the MII registers using software-generated serial
1113
static void parse_eeprom(unsigned short *eeprom)
1115
unsigned char *p = (void *)eeprom;
1119
printf("Saved EEPROM settings of a 3Com Vortex/Boomerang:\n");
1120
if (eeprom[0x37] == 0x6d50) {
1121
printf(" The CardBus product ID is %4.4x %4.4x.\n",
1122
eeprom[0], eeprom[1]);
1126
printf(" 3Com Node Address ");
1127
for (i = 0; i < 5; i++)
1128
printf("%2.2X:", p[i^1]);
1129
printf("%2.2X (used as a unique ID only).\n", p[i^1]);
1130
printf(" OEM Station address %2.2x", p[1 + 20]);
1131
for (i = 1; i < 6; i++)
1132
printf(":%2.2X", p[(i^1) + 20]);
1133
printf(" (used as the ethernet address).\n");
1134
/* The original 3Com layout did not consider post-Y2K production. */
1135
printf(" Manufacture date (MM/DD/YYYY) %d/%d/%d, division %c,"
1136
" product %c%c.\n", ((p[8]>>5) & 7) + ((p[9]<<3) & 8),
1137
p[8] & 31, (p[9]>>1) + ((p[9]>>1) < 95 ? 2000 : 1900),
1138
p[10], p[12], p[13]);
1139
printf(" Options: %s duplex, link beat %s.\n",
1140
ee[13] & 0x8000 ? "force full" : "negotiated",
1141
ee[13] & 0x4000 ? "check disabled" : "required");
1142
for (i = 0; i < 0x16; i++)
1144
printf(" Vortex format checksum is %scorrect (%4.4x vs. %4.4x).\n",
1145
((sum ^ (sum>>8)) & 0xff) == ee[0x17] ? "" : "in",
1146
(sum ^ (sum>>8)) & 0xff, ee[0x17]);
1147
for ( ; i < 0x1A; i++)
1150
printf(" Cyclone format checksum is %scorrect (%#2.2x vs. %#2.2x).\n",
1151
(sum & 0xff) == (ee[0x20] & 0xff) ? "" : "in",
1152
sum & 0xff, ee[0x20] & 0xff);
1153
for (sum = 0, i = 0; i < 0x20*2; i++)
1154
sum ^= ((unsigned char *)ee)[i];
1155
printf(" Hurricane format checksum is %scorrect (%#2.2x vs. %#2.2x).\n",
1156
sum == (ee[0x20] & 0xff) ? "" : "in",
1157
sum, ee[0x20] & 0xff);
1161
1330
static void show_dma_state(long ioaddr)
1163
1332
int dma_ctrl = inl(ioaddr + 0x20);