Author: yongari
Date: Wed Jan  4 01:38:52 2012
New Revision: 229452
URL: http://svn.freebsd.org/changeset/base/229452

Log:
  MFC r227675:
    Partially revert r218788. r218788 removed calling dc_setcfg() for
    !DC_IS_ADMTEK in dc_miibus_statchg(). This change broke link
    establishment of Intel 21143 with dcphy(4) where it stuck in
    "ability detect" state without completing auto-negotiation.
    Also nuke dc_if_media as it's not actually used.

Modified:
  stable/9/sys/dev/dc/if_dc.c
  stable/9/sys/dev/dc/if_dcreg.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/dev/dc/if_dc.c
==============================================================================
--- stable/9/sys/dev/dc/if_dc.c Wed Jan  4 00:51:05 2012        (r229451)
+++ stable/9/sys/dev/dc/if_dc.c Wed Jan  4 01:38:52 2012        (r229452)
@@ -856,12 +856,11 @@ dc_miibus_statchg(device_t dev)
                return;
 
        ifm = &mii->mii_media;
-       if (DC_IS_DAVICOM(sc) &&
-           IFM_SUBTYPE(ifm->ifm_media) == IFM_HPNA_1) {
+       if (DC_IS_DAVICOM(sc) && IFM_SUBTYPE(ifm->ifm_media) == IFM_HPNA_1) {
                dc_setcfg(sc, ifm->ifm_media);
-               sc->dc_if_media = ifm->ifm_media;
                return;
-       }
+       } else if (!DC_IS_ADMTEK(sc))
+               dc_setcfg(sc, mii->mii_media_active);
 
        sc->dc_link = 0;
        if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) ==
@@ -871,17 +870,8 @@ dc_miibus_statchg(device_t dev)
                case IFM_100_TX:
                        sc->dc_link = 1;
                        break;
-               default:
-                       break;
                }
        }
-       if (sc->dc_link == 0)
-               return;
-
-       sc->dc_if_media = mii->mii_media_active;
-       if (DC_IS_ADMTEK(sc))
-               return;
-       dc_setcfg(sc, mii->mii_media_active);
 }
 
 /*

Modified: stable/9/sys/dev/dc/if_dcreg.h
==============================================================================
--- stable/9/sys/dev/dc/if_dcreg.h      Wed Jan  4 00:51:05 2012        
(r229451)
+++ stable/9/sys/dev/dc/if_dcreg.h      Wed Jan  4 01:38:52 2012        
(r229452)
@@ -760,7 +760,6 @@ struct dc_softc {
        int                     dc_pnic_rx_bug_save;
        unsigned char           *dc_pnic_rx_buf;
        int                     dc_if_flags;
-       int                     dc_if_media;
        uint32_t                dc_flags;
        uint32_t                dc_txthresh;
        uint32_t                dc_eaddr[2];
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to