From owner-freebsd-current@FreeBSD.ORG Wed Dec 17 04:28:45 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2EAA1065672 for ; Wed, 17 Dec 2008 04:28:45 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.232]) by mx1.freebsd.org (Postfix) with ESMTP id 6786D8FC16 for ; Wed, 17 Dec 2008 04:28:45 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so4704397rvf.43 for ; Tue, 16 Dec 2008 20:28:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:received:date:from :to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=UonKuQovCTH8EtMRkLAw7E/ftBOia4CB1uVczOfZu3A=; b=V3GvTDT4svxxDmmVxbpxxNGpUvNZ7iy8DTRYQ+PFtA/Eb6WaWa6tpI63fDtabWCX3z 8kPtfnaTMdQJR8HSB4U0Pjy6hj1Y+Yu0PAOda1QYapfHz3WzY0ZxOtcxSswA+XOC0HuM GYXrhFemfZhaHjwpZswY213b0KZ8V9JzIJOZ4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=wRsX8WPs3SjDNtan3vB7ix0oNoLToVTIPeIfZnxpYO3MKh3g3/Dz9IxP80SrVaXKDH fjGYsAIyTlPLaKxXwUVXkFH0iCy6NV74Amj3/NLhoNpEbD8b8mLWYjC+jEGckwpvBeWh DlzpeS1FxmBZAe6bq7FefVmmQy90PqKC2Bli8= Received: by 10.141.96.19 with SMTP id y19mr182088rvl.89.1229488124957; Tue, 16 Dec 2008 20:28:44 -0800 (PST) Received: from michelle.cdnetworks.co.kr ([211.53.35.84]) by mx.google.com with ESMTPS id g31sm6155943rvb.4.2008.12.16.20.28.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 16 Dec 2008 20:28:44 -0800 (PST) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.13.5/8.13.5) with ESMTP id mBH4SbVB067901 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 17 Dec 2008 13:28:37 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id mBH4SbZe067900; Wed, 17 Dec 2008 13:28:37 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Wed, 17 Dec 2008 13:28:37 +0900 From: Pyun YongHyeon To: Bruce Cran Message-ID: <20081217042837.GE66999@cdnetworks.co.kr> References: <4947E59A.8000408@cran.org.uk> <20081217005106.GA66999@cdnetworks.co.kr> <49486EDD.6060607@cran.org.uk> <20081217034155.GB66999@cdnetworks.co.kr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="IiVenqGWf+H9Y6IX" Content-Disposition: inline In-Reply-To: <20081217034155.GB66999@cdnetworks.co.kr> User-Agent: Mutt/1.4.2.1i Cc: current@freebsd.org Subject: Re: RTL8102E (if_re) doesn't work with -current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2008 04:28:45 -0000 --IiVenqGWf+H9Y6IX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Dec 17, 2008 at 12:41:55PM +0900, To Bruce Cran wrote: > On Tue, Dec 16, 2008 at 07:15:41PM -0800, Bruce Cran wrote: > > Pyun YongHyeon wrote: > > >On Tue, Dec 16, 2008 at 09:30:02AM -0800, Bruce Cran wrote: > > > > I just upgraded an HP Pavillion laptop from 7.1-RC1 to 8-CURRENT last > > > > night and now the network doesn't work. This laptop has a RTL8102E > > > > chip, and no errors appear in the logs - it attaches and doesn't claim > > > > to have any TX/RX errors, but it just doesn't do anything. I've > > > > attached the dmesg from a verbose boot. I've seen messages saying > > > > there might be issues with MSI interrupts - is that possibly an issue > > > here? > > > > > > > > > >No, it is in disabled state by default. > > >The issue could be related with link state tracking code in re(4). > > >Would you show me the output of "devinfo -rv | grep rlphy"? > > >How about unplugging/replugging UTP cable? > > >Does it make any difference? > > > > > > > devinfo provides the output: > > rlphy0 pnpinfo oui=0x20 model=0x20 rev=0x1 at phyno=1 > > > > I let the startup continue so that dhclient was still running in the > > background, and I started getting lots of messages: > > > > arp: 00:1e:ec:72:2b:8e attempts to modify permanent entry for 0.0.0.0 on re0 > > > > After unplugging the replugging the UTP cable the messages > > > > re0: link state changed to DOWN > > re0: link state changed to UP > > > > apppeared in the logs but dhclient still didn't get any replies, and the > > arp messages started again. > > > > Hmm, this seem to happen when link partner doesn't support NWAY > autonegotiation. Can you confirm that? > And would you try attached patch? Also show me the outout of > "ifconfig re0" before/after applying attached patch. Please try this one, there was a typo in previous patch. -- Regards, Pyun YongHyeon --IiVenqGWf+H9Y6IX Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="rlphy.patch2" Index: sys/dev/mii/rlphy.c =================================================================== --- sys/dev/mii/rlphy.c (revision 186170) +++ sys/dev/mii/rlphy.c (working copy) @@ -60,6 +60,9 @@ struct rlphy_softc { struct mii_softc sc_mii; /* generic PHY */ int sc_is_RTL8201L; /* is an external RTL8201L PHY */ + int flags; +#define RLPHY_FLAGS_RL 0x01 +#define RLPHY_FLAGS_RE 0x02 }; static int rlphy_probe(device_t); @@ -125,6 +128,7 @@ struct mii_attach_args *ma; struct mii_data *mii; struct rlphy_softc *rsc; + const char *nic; sc = device_get_softc(dev); ma = device_get_ivars(dev); @@ -138,6 +142,11 @@ rsc = (struct rlphy_softc *)sc; if (mii_phy_dev_probe(dev, rlphys, 0) == 0) rsc->sc_is_RTL8201L++; + nic = device_get_name(device_get_parent(sc->mii_dev)); + if (strcmp(nic, "re") == 0) + rsc->flags |= RLPHY_FLAGS_RE; + else if (strcmp(nic, "rl") == 0) + rsc->flags |= RLPHY_FLAGS_RL; /* * The RealTek PHY can never be isolated, so never allow non-zero @@ -302,18 +311,25 @@ * can test the 'SPEED10' bit of the MAC's media status * register. */ - if (rsc->sc_is_RTL8201L) { - if (PHY_READ(phy, 0x0019) & 0x01) + if (rsc->flags & RLPHY_FLAGS_RE) { + if (PHY_READ(phy, RL_GMEDIASTAT) & + RL_GMEDIASTAT_100MBPS) mii->mii_media_active |= IFM_100_TX; else mii->mii_media_active |= IFM_10_T; - } else { + } else if (rsc->flags & RLPHY_FLAGS_RL) { if (PHY_READ(phy, RL_MEDIASTAT) & RL_MEDIASTAT_SPEED10) mii->mii_media_active |= IFM_10_T; else mii->mii_media_active |= IFM_100_TX; - } + } else if (rsc->sc_is_RTL8201L) { + if (PHY_READ(phy, 0x0019) & 0x01) + mii->mii_media_active |= IFM_100_TX; + else + mii->mii_media_active |= IFM_10_T; + } else + mii->mii_media_active |= IFM_NONE; } else mii->mii_media_active = ife->ifm_media; } --IiVenqGWf+H9Y6IX--