From owner-freebsd-current@FreeBSD.ORG Wed Dec 17 03:42:03 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 481B3106564A for ; Wed, 17 Dec 2008 03:42:03 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.233]) by mx1.freebsd.org (Postfix) with ESMTP id 09D1E8FC1D for ; Wed, 17 Dec 2008 03:42:02 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so4675096rvf.43 for ; Tue, 16 Dec 2008 19:42:02 -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=hFK7Rpo6lQxPtEs+7MS+UnvF9zTNoBk2xzyuqJbyVT4=; b=r19THyaOo+tRzIYwskKHVHhs72wWVYRqYwYFPfMyX4XnifoDSfH6Af8RaQGUBNAl3D MNhjuHjA15tE9j+fp976kbFNBLcR9+HZOcwTarBIZ62DvggcxW5wxT1By4gayU/mrGW/ cRD0Ds9G7rQ2xqDB3csgEiSPzMTt8y6ray74U= 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=LngeNP7vEyykHjK5EEV6COnuroLYi9b9TP4V0KMPt+mZm0SS1CLSEiGtFuMRnFXawx fmGuXQGnDiQjLvbWUcX8g6ZBv3ALUv+MTMlGQUIqYZRzO2gguh+vCjqNTwtrThFNTGbX muvPNVfUVYcIPoY4gsBkFfZy8ruCLvIRnXHRI= Received: by 10.140.188.19 with SMTP id l19mr170335rvf.51.1229485322574; Tue, 16 Dec 2008 19:42:02 -0800 (PST) Received: from michelle.cdnetworks.co.kr ([211.53.35.84]) by mx.google.com with ESMTPS id f21sm2011859rvb.7.2008.12.16.19.41.59 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 16 Dec 2008 19:42:01 -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 mBH3fui8067685 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 17 Dec 2008 12:41:56 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id mBH3ftR8067684; Wed, 17 Dec 2008 12:41:55 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Wed, 17 Dec 2008 12:41:55 +0900 From: Pyun YongHyeon To: Bruce Cran Message-ID: <20081217034155.GB66999@cdnetworks.co.kr> References: <4947E59A.8000408@cran.org.uk> <20081217005106.GA66999@cdnetworks.co.kr> <49486EDD.6060607@cran.org.uk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="zhXaljGHf11kAtnf" Content-Disposition: inline In-Reply-To: <49486EDD.6060607@cran.org.uk> 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 03:42:03 -0000 --zhXaljGHf11kAtnf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. -- Regards, Pyun YongHyeon --zhXaljGHf11kAtnf Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="rlphy.patch" 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; - } + } 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; } --zhXaljGHf11kAtnf--