-/* $OpenBSD: mii.c,v 1.7 2000/04/24 21:13:33 niklas Exp $ */
+/* $OpenBSD: mii.c,v 1.8 2000/04/27 07:37:13 niklas Exp $ */
/* $NetBSD: mii.c,v 1.9 1998/11/05 04:08:02 thorpej Exp $ */
/*-
* ARGH!! 3Com internal PHYs report 0/0 in their
* ID registers! If we spot this, check to see
* if the BMSR has reasonable data in it.
+ * And if that wasn't enough there are PHYs
+ * reporting 0xffff/0xffff too.
*/
- if (MII_OUI(ma.mii_id1, ma.mii_id2) == 0 &&
- MII_MODEL(ma.mii_id2) == 0) {
+ if ((MII_OUI(ma.mii_id1, ma.mii_id2) == 0 &&
+ MII_MODEL(ma.mii_id2) == 0) ||
+ (MII_OUI(ma.mii_id1, ma.mii_id2) == 0x3fffff &&
+ MII_MODEL(ma.mii_id2) == 0x3f)) {
int bmsr = (*mii->mii_readreg)(parent,
ma.mii_phyno, MII_BMSR);
if (bmsr == 0 || bmsr == 0xffff ||