Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Nov 2011 19:38:20 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r227675 - head/sys/dev/dc
Message-ID:  <201111181938.pAIJcKHN093948@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Fri Nov 18 19:38:19 2011
New Revision: 227675
URL: http://svn.freebsd.org/changeset/base/227675

Log:
  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.
  
  Submitted by:	marius

Modified:
  head/sys/dev/dc/if_dc.c
  head/sys/dev/dc/if_dcreg.h

Modified: head/sys/dev/dc/if_dc.c
==============================================================================
--- head/sys/dev/dc/if_dc.c	Fri Nov 18 19:14:42 2011	(r227674)
+++ head/sys/dev/dc/if_dc.c	Fri Nov 18 19:38:19 2011	(r227675)
@@ -860,12 +860,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)) ==
@@ -875,17 +874,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: head/sys/dev/dc/if_dcreg.h
==============================================================================
--- head/sys/dev/dc/if_dcreg.h	Fri Nov 18 19:14:42 2011	(r227674)
+++ head/sys/dev/dc/if_dcreg.h	Fri Nov 18 19:38:19 2011	(r227675)
@@ -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];



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111181938.pAIJcKHN093948>