From owner-svn-src-head@FreeBSD.ORG Fri Mar 30 05:27:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86C57106566C; Fri, 30 Mar 2012 05:27:06 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 714F78FC12; Fri, 30 Mar 2012 05:27:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2U5R6Yv026366; Fri, 30 Mar 2012 05:27:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2U5R64X026364; Fri, 30 Mar 2012 05:27:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201203300527.q2U5R64X026364@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 30 Mar 2012 05:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233689 - head/sys/dev/ale X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Mar 2012 05:27:06 -0000 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);