4 Created: Nov 2004 by Philip Homburg <philip@f-mnx.phicoh.com>
6 Media Independent (Ethernet) Interface functions
9 #include "../drivers.h"
16 /*===========================================================================*
17 * mii_print_stat_speed *
18 *===========================================================================*/
19 PUBLIC
void mii_print_stat_speed(stat
, extstat
)
26 if (stat
& MII_STATUS_EXT_STAT
)
28 if (extstat
& (MII_ESTAT_1000XFD
| MII_ESTAT_1000XHD
|
29 MII_ESTAT_1000TFD
| MII_ESTAT_1000THD
))
31 printf("1000 Mbps: ");
34 if (extstat
& (MII_ESTAT_1000XFD
| MII_ESTAT_1000XHD
))
39 (MII_ESTAT_1000XFD
|MII_ESTAT_1000XHD
))
41 case MII_ESTAT_1000XFD
: printf("FD"); break;
42 case MII_ESTAT_1000XHD
: printf("HD"); break;
43 default: printf("FD/HD"); break;
46 if (extstat
& (MII_ESTAT_1000TFD
| MII_ESTAT_1000THD
))
53 (MII_ESTAT_1000TFD
|MII_ESTAT_1000THD
))
55 case MII_ESTAT_1000TFD
: printf("FD"); break;
56 case MII_ESTAT_1000THD
: printf("HD"); break;
57 default: printf("FD/HD"); break;
62 if (stat
& (MII_STATUS_100T4
|
63 MII_STATUS_100XFD
| MII_STATUS_100XHD
|
64 MII_STATUS_100T2FD
| MII_STATUS_100T2HD
))
71 if (stat
& MII_STATUS_100T4
)
76 if (stat
& (MII_STATUS_100XFD
| MII_STATUS_100XHD
))
82 switch(stat
& (MII_STATUS_100XFD
|MII_STATUS_100XHD
))
84 case MII_STATUS_100XFD
: printf("FD"); break;
85 case MII_STATUS_100XHD
: printf("HD"); break;
86 default: printf("FD/HD"); break;
89 if (stat
& (MII_STATUS_100T2FD
| MII_STATUS_100T2HD
))
95 switch(stat
& (MII_STATUS_100T2FD
|MII_STATUS_100T2HD
))
97 case MII_STATUS_100T2FD
: printf("FD"); break;
98 case MII_STATUS_100T2HD
: printf("HD"); break;
99 default: printf("FD/HD"); break;
103 if (stat
& (MII_STATUS_10FD
| MII_STATUS_10HD
))
110 switch(stat
& (MII_STATUS_10FD
|MII_STATUS_10HD
))
112 case MII_STATUS_10FD
: printf("FD"); break;
113 case MII_STATUS_10HD
: printf("HD"); break;
114 default: printf("FD/HD"); break;
119 /*===========================================================================*
121 *===========================================================================*/
122 PUBLIC
void mii_print_techab(techab
)
127 if ((techab
& MII_ANA_SEL_M
) != MII_ANA_SEL_802_3
)
129 printf("strange selector 0x%x, value 0x%x",
130 techab
& MII_ANA_SEL_M
,
131 (techab
& MII_ANA_TAF_M
) >> MII_ANA_TAF_S
);
135 if (techab
& (MII_ANA_100T4
| MII_ANA_100TXFD
| MII_ANA_100TXHD
))
137 printf("100 Mbps: ");
140 if (techab
& MII_ANA_100T4
)
145 if (techab
& (MII_ANA_100TXFD
| MII_ANA_100TXHD
))
151 switch(techab
& (MII_ANA_100TXFD
|MII_ANA_100TXHD
))
153 case MII_ANA_100TXFD
: printf("FD"); break;
154 case MII_ANA_100TXHD
: printf("HD"); break;
155 default: printf("FD/HD"); break;
159 if (techab
& (MII_ANA_10TFD
| MII_ANA_10THD
))
166 switch(techab
& (MII_ANA_10TFD
|MII_ANA_10THD
))
168 case MII_ANA_10TFD
: printf("FD"); break;
169 case MII_ANA_10THD
: printf("HD"); break;
170 default: printf("FD/HD"); break;
173 if (techab
& MII_ANA_PAUSE_SYM
)
178 printf("pause(SYM)");
180 if (techab
& MII_ANA_PAUSE_ASYM
)
185 printf("pause(ASYM)");
187 if (techab
& MII_ANA_TAF_RES
)
192 printf("0x%x", (techab
& MII_ANA_TAF_RES
) >> MII_ANA_TAF_S
);
197 * $PchId: mii.c,v 1.2 2005/01/31 22:17:26 philip Exp $