Some PHYs does not report any OUI/MODEL combo, recognize another such case
authorniklas <niklas@openbsd.org>
Thu, 27 Apr 2000 07:37:13 +0000 (07:37 +0000)
committerniklas <niklas@openbsd.org>
Thu, 27 Apr 2000 07:37:13 +0000 (07:37 +0000)
sys/dev/mii/mii.c

index 625d898..59388fc 100644 (file)
@@ -1,4 +1,4 @@
-/*     $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 $  */
 
 /*-
@@ -91,9 +91,13 @@ mii_phy_probe(parent, mii, capmask)
                         * 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 ||