RTL8102E (if_re) doesn't work with -current

Pyun YongHyeon pyunyh at gmail.com
Fri Dec 19 00:47:45 UTC 2008


On Wed, Dec 17, 2008 at 11:32:34PM -0500, Bruce Cran wrote:
 > On Wed, Dec 17, 2008 at 06:19:34PM +0900, Pyun YongHyeon wrote:
 > > 
 > > Oops, please forget previous patch and use attached patch instead.
 > > 
 > > Index: if_re.c
 > > ===================================================================
 > > --- if_re.c	(revision 186214)
 > > +++ if_re.c	(working copy)
 > > @@ -2681,7 +2681,14 @@
 > >  	ifp->if_drv_flags |= IFF_DRV_RUNNING;
 > >  	ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
 > >  
 > > -	sc->rl_flags &= ~RL_FLAG_LINK;
 > > +	/*
 > > +	 * XXX
 > > +	 * Since we don't request reset for rlphy(4), it's necessary
 > > +	 * to set initial (fake) link state. Otherwise re(4) wouldn't
 > > +	 * work as link state 'UP' event from mii(4) may not be
 > > +	 * delivered if the valid link was already established.
 > > +	 */
 > > +	sc->rl_flags |= RL_FLAG_LINK;
 > >  	sc->rl_watchdog_timer = 0;
 > >  	callout_reset(&sc->rl_stat_callout, hz, re_tick, sc);
 > >  }
 > 
 > With that patch applied (I kept the changes to rlphy.c too) the network is 
 > now working again.  Thanks!
 > 

Thanks for testing!
Becasue there is possibility of watchdog timeouts would you please
try attached patch again? (Make sure to backout all the applied
patches before testing new patch.)

-- 
Regards,
Pyun YongHyeon
-------------- next part --------------
Index: sys/dev/re/if_re.c
===================================================================
--- sys/dev/re/if_re.c	(revision 186214)
+++ sys/dev/re/if_re.c	(working copy)
@@ -2693,12 +2693,17 @@
 re_ifmedia_upd(struct ifnet *ifp)
 {
 	struct rl_softc		*sc;
+	struct mii_softc	*miisc;
 	struct mii_data		*mii;
 	int			error;
 
 	sc = ifp->if_softc;
 	mii = device_get_softc(sc->rl_miibus);
 	RL_LOCK(sc);
+	if (mii->mii_instance) {
+		LIST_FOREACH(miisc, &mii->mii_phys, mii_list)
+			mii_phy_reset(miisc);
+	}
 	error = mii_mediachg(mii);
 	RL_UNLOCK(sc);
 


More information about the freebsd-current mailing list