Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/mii Use BMSR to test for `negotiation complete'; the...



details:   https://anonhg.NetBSD.org/src/rev/3aabcbdd20c7
branches:  trunk
changeset: 479783:3aabcbdd20c7
user:      pk <pk%NetBSD.org@localhost>
date:      Tue Dec 21 10:47:00 1999 +0000

description:
Use BMSR to test for `negotiation complete'; the alternative bit in the
LXT vendor register 20 is latching high and resets to low on read causing
subsequent status request to return `IFM_NONE'.

diffstat:

 sys/dev/mii/lxtphy.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 0b3dd998a485 -r 3aabcbdd20c7 sys/dev/mii/lxtphy.c
--- a/sys/dev/mii/lxtphy.c      Tue Dec 21 09:27:43 1999 +0000
+++ b/sys/dev/mii/lxtphy.c      Tue Dec 21 10:47:00 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lxtphy.c,v 1.13 1999/11/12 18:13:00 thorpej Exp $      */
+/*     $NetBSD: lxtphy.c,v 1.14 1999/12/21 10:47:00 pk Exp $   */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -255,7 +255,7 @@
 {
        struct mii_data *mii = sc->mii_pdata;
        struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
-       int bmcr, csr;
+       int bmcr, bmsr, csr;
 
        mii->mii_media_status = IFM_AVALID;
        mii->mii_media_active = IFM_ETHER;
@@ -280,7 +280,8 @@
                mii->mii_media_active |= IFM_LOOP;
 
        if (bmcr & BMCR_AUTOEN) {
-               if ((csr & CSR_ACOMP) == 0) {
+               bmsr = PHY_READ(sc, MII_BMSR) | PHY_READ(sc, MII_BMSR);
+               if ((bmsr & BMSR_ACOMP) == 0) {
                        /* Erg, still trying, I guess... */
                        mii->mii_media_active |= IFM_NONE;
                        return;



Home | Main Index | Thread Index | Old Index