From owner-svn-src-all@FreeBSD.ORG Wed Jan 27 14:43:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84679106568B; Wed, 27 Jan 2010 14:43:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73B3D8FC0A; Wed, 27 Jan 2010 14:43:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0REhSwh043117; Wed, 27 Jan 2010 14:43:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0REhS0B043115; Wed, 27 Jan 2010 14:43:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001271443.o0REhS0B043115@svn.freebsd.org> From: John Baldwin Date: Wed, 27 Jan 2010 14:43:28 +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: r203070 - head/sys/dev/nve X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2010 14:43:28 -0000 Author: jhb Date: Wed Jan 27 14:43:28 2010 New Revision: 203070 URL: http://svn.freebsd.org/changeset/base/203070 Log: Initialize the ifnet before calling mii_phy_probe() as some phy drivers (e.g. e1000phy(4)) expect if_dname to be valid when they are probed. MFC after: 3 days Modified: head/sys/dev/nve/if_nve.c Modified: head/sys/dev/nve/if_nve.c ============================================================================== --- head/sys/dev/nve/if_nve.c Wed Jan 27 14:17:33 2010 (r203069) +++ head/sys/dev/nve/if_nve.c Wed Jan 27 14:43:28 2010 (r203070) @@ -526,14 +526,6 @@ nve_attach(device_t dev) goto fail; } - /* Probe device for MII interface to PHY */ - DEBUGOUT(NVE_DEBUG_INIT, "nve: do mii_phy_probe\n"); - if (mii_phy_probe(dev, &sc->miibus, nve_ifmedia_upd, nve_ifmedia_sts)) { - device_printf(dev, "MII without any phy!\n"); - error = ENXIO; - goto fail; - } - /* Setup interface parameters */ ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); @@ -549,6 +541,14 @@ nve_attach(device_t dev) ifp->if_capabilities |= IFCAP_VLAN_MTU; ifp->if_capenable |= IFCAP_VLAN_MTU; + /* Probe device for MII interface to PHY */ + DEBUGOUT(NVE_DEBUG_INIT, "nve: do mii_phy_probe\n"); + if (mii_phy_probe(dev, &sc->miibus, nve_ifmedia_upd, nve_ifmedia_sts)) { + device_printf(dev, "MII without any phy!\n"); + error = ENXIO; + goto fail; + } + /* Attach to OS's managers. */ ether_ifattach(ifp, eaddr);