Date: Fri, 30 Mar 2012 05:27:06 +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: r233689 - head/sys/dev/ale Message-ID: <201203300527.q2U5R64X026364@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: yongari Date: Fri Mar 30 05:27:05 2012 New Revision: 233689 URL: http://svn.freebsd.org/changeset/base/233689 Log: Do not report current link status if driver is not running. This change also workarounds dhclient's link state handling bug by not giving current link status. Unlike other controllers, ale(4)'s PHY hibernation perfectly works such that driver does not see a valid link if the controller is not brought up. If dhclient(8) runs on ale(4) it will blindly waits until link UP and then gives up after 10 seconds. Because dhclient(8) still thinks interface got a valid link when IFM_AVALID is not set for selected media, this change makes dhclient initiate DHCP without waiting for link UP. Modified: head/sys/dev/ale/if_ale.c Modified: head/sys/dev/ale/if_ale.c ============================================================================== --- head/sys/dev/ale/if_ale.c Fri Mar 30 04:46:39 2012 (r233688) +++ head/sys/dev/ale/if_ale.c Fri Mar 30 05:27:05 2012 (r233689) @@ -301,6 +301,10 @@ ale_mediastatus(struct ifnet *ifp, struc sc = ifp->if_softc; ALE_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + ALE_UNLOCK(sc); + return; + } mii = device_get_softc(sc->ale_miibus); mii_pollstat(mii);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203300527.q2U5R64X026364>