4 Created: Nov 2004 by Philip Homburg <philip@f-mnx.phicoh.com>
6 Media Independent (Ethernet) Interface functions
9 #include <minix/drivers.h>
16 /*===========================================================================*
17 * mii_print_stat_speed *
18 *===========================================================================*/
19 void mii_print_stat_speed(u16_t stat
, u16_t extstat
)
24 if (stat
& MII_STATUS_EXT_STAT
)
26 if (extstat
& (MII_ESTAT_1000XFD
| MII_ESTAT_1000XHD
|
27 MII_ESTAT_1000TFD
| MII_ESTAT_1000THD
))
29 printf("1000 Mbps: ");
32 if (extstat
& (MII_ESTAT_1000XFD
| MII_ESTAT_1000XHD
))
37 (MII_ESTAT_1000XFD
|MII_ESTAT_1000XHD
))
39 case MII_ESTAT_1000XFD
: printf("FD"); break;
40 case MII_ESTAT_1000XHD
: printf("HD"); break;
41 default: printf("FD/HD"); break;
44 if (extstat
& (MII_ESTAT_1000TFD
| MII_ESTAT_1000THD
))
51 (MII_ESTAT_1000TFD
|MII_ESTAT_1000THD
))
53 case MII_ESTAT_1000TFD
: printf("FD"); break;
54 case MII_ESTAT_1000THD
: printf("HD"); break;
55 default: printf("FD/HD"); break;
60 if (stat
& (MII_STATUS_100T4
|
61 MII_STATUS_100XFD
| MII_STATUS_100XHD
|
62 MII_STATUS_100T2FD
| MII_STATUS_100T2HD
))
69 if (stat
& MII_STATUS_100T4
)
74 if (stat
& (MII_STATUS_100XFD
| MII_STATUS_100XHD
))
80 switch(stat
& (MII_STATUS_100XFD
|MII_STATUS_100XHD
))
82 case MII_STATUS_100XFD
: printf("FD"); break;
83 case MII_STATUS_100XHD
: printf("HD"); break;
84 default: printf("FD/HD"); break;
87 if (stat
& (MII_STATUS_100T2FD
| MII_STATUS_100T2HD
))
93 switch(stat
& (MII_STATUS_100T2FD
|MII_STATUS_100T2HD
))
95 case MII_STATUS_100T2FD
: printf("FD"); break;
96 case MII_STATUS_100T2HD
: printf("HD"); break;
97 default: printf("FD/HD"); break;
101 if (stat
& (MII_STATUS_10FD
| MII_STATUS_10HD
))
108 switch(stat
& (MII_STATUS_10FD
|MII_STATUS_10HD
))
110 case MII_STATUS_10FD
: printf("FD"); break;
111 case MII_STATUS_10HD
: printf("HD"); break;
112 default: printf("FD/HD"); break;
117 /*===========================================================================*
119 *===========================================================================*/
120 void mii_print_techab(u16_t techab
)
124 if ((techab
& MII_ANA_SEL_M
) != MII_ANA_SEL_802_3
)
126 printf("strange selector 0x%x, value 0x%x",
127 techab
& MII_ANA_SEL_M
,
128 (techab
& MII_ANA_TAF_M
) >> MII_ANA_TAF_S
);
132 if (techab
& (MII_ANA_100T4
| MII_ANA_100TXFD
| MII_ANA_100TXHD
))
134 printf("100 Mbps: ");
137 if (techab
& MII_ANA_100T4
)
142 if (techab
& (MII_ANA_100TXFD
| MII_ANA_100TXHD
))
148 switch(techab
& (MII_ANA_100TXFD
|MII_ANA_100TXHD
))
150 case MII_ANA_100TXFD
: printf("FD"); break;
151 case MII_ANA_100TXHD
: printf("HD"); break;
152 default: printf("FD/HD"); break;
156 if (techab
& (MII_ANA_10TFD
| MII_ANA_10THD
))
163 switch(techab
& (MII_ANA_10TFD
|MII_ANA_10THD
))
165 case MII_ANA_10TFD
: printf("FD"); break;
166 case MII_ANA_10THD
: printf("HD"); break;
167 default: printf("FD/HD"); break;
170 if (techab
& MII_ANA_PAUSE_SYM
)
175 printf("pause(SYM)");
177 if (techab
& MII_ANA_PAUSE_ASYM
)
182 printf("pause(ASYM)");
184 if (techab
& MII_ANA_TAF_RES
)
189 printf("0x%x", (techab
& MII_ANA_TAF_RES
) >> MII_ANA_TAF_S
);
194 * $PchId: mii.c,v 1.2 2005/01/31 22:17:26 philip Exp $