From owner-freebsd-current@FreeBSD.ORG Sun Nov 18 09:37:14 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9972516A469 for ; Sun, 18 Nov 2007 09:37:14 +0000 (UTC) (envelope-from jackqqpro@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.187]) by mx1.freebsd.org (Postfix) with ESMTP id 2BD6713C458 for ; Sun, 18 Nov 2007 09:37:13 +0000 (UTC) (envelope-from jackqqpro@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so1139677nfb for ; Sun, 18 Nov 2007 01:37:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=q9qZR8KBiQ89eeJn/LjdbN0SP6PC+T598VlQo/2waao=; b=hONJdUxGs+pih/+l8yZi4OCQFoqxlL6jrxSlhrcltiUTekEaKEmDqv5tubOHSKx+2Ct0bJGAknNcNa46NNCqBSmi2UX+RVHSXuJRHVkrQXNPAAbslRhReuy3k5uC83VEZyO0Q7Vi5WQlbtm6UX16uT6QYSSRTlpDj8rp5YnRUP4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=o1idVcxbUX0qS2zovArvGYyVDd2l8ZHzik10vp4bG7VU6P2FX0Pb9JfSLvNcLr7EfofRYjTAo2iUBWsQtMnFFBmj1rksuJ3w9IiBIc+Y1/gy6W3wQK2B5JaVF+3Yr/OICx7OV357LYE6zd3jjBDBapJpfX/zfnx/6N3zBq5psL4= Received: by 10.78.172.20 with SMTP id u20mr3763829hue.1195378623906; Sun, 18 Nov 2007 01:37:03 -0800 (PST) Received: by 10.78.185.18 with HTTP; Sun, 18 Nov 2007 01:37:03 -0800 (PST) Message-ID: <890a507f0711180137r5517eae9h9fdbefb42d3cd0d7@mail.gmail.com> Date: Sun, 18 Nov 2007 17:37:03 +0800 From: "Quan Qiu" To: freebsd-current@freebsd.org In-Reply-To: <473DAEB9.5080304@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <890a507f0711160615i371a60e1o1b8695176e92dcda@mail.gmail.com> <473DAEB9.5080304@gmail.com> Cc: "Aryeh M. Friedman" Subject: Re: Onboard RTL8111C not attached to by re(4) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2007 09:37:14 -0000 On Nov 16, 2007 10:52 PM, Aryeh M. Friedman wrote: > > Something else must be going on because on my Mobo (MSI Neo-F > [P35/IHC9]) I have no issue with this (and never have [except for some > re(4) issues that have nothing to do with reconizing the nic]): > > > re0@pci0:4:0:0: class=0x020000 card=0x360c1462 chip=0x816810ec > rev=0x01 hdr=0x00 > vendor = 'Realtek Semiconductor' > device = 'RTL8168/8111 PCI-E Gigabit Ethernet NIC' > class = network > subclass = ethernet > > > re0: port 0xe800-0xe8ff mem > 0xfcfff000-0xfcffffff irq 17 at device 0.0 on pci4 > re0: Using 2 MSI messages > miibus0: on re0 > re0: Ethernet address: 00:19:db:b5:f8:0f > re0: [FILTER] > re0: [FILTER] > > FreeBSD monster 8.0-CURRENT FreeBSD 8.0-CURRENT #1: Thu Nov 15 > 19:17:50 EST 2007 > aryeh@monster:/usr/obj/FreeBSD/FreeBSD-current/src/sys/MONSTER amd64 > > > Your card is discovered as card=0x360c1462, mine as card=0xe0001458. I think yours is really a 8168/8111B, while mine is a 8111C. Accroding to the followling line in /sys/dev/re/if_re.c, re_attach(dev), hwrev = CSR_READ_4(sc, RL_TXCFG) & RL_TXCFG_HWREV; and the definition in /sys/pci/if_rlreg.h, #define RL_TXCFG_HWREV 0x7CC00000 I traced a debug kernel and found that CSR_READ_4(sc, RL_TXCFG) for my card is 0x3f2000c0 so the masked hwrev should be 0x3c000000 I added this line in /sys/pci/if_rlreg.h, #define RL_HWREV_8111C 0x3c000000 and these lines to the table in /sys/dev/re/if_re.c, { RT_VENDORID, RT_DEVICEID_8168, RL_HWREV_8111C, "RealTek 8111C Single-Chip PCIe Gigabit Ethernet" }, and these to the table in the same .c. { RL_HWREV_8111C, RL_8169, "8111C"}, After reboot, re(4) successfully recognized the chip. However, it failed with the following error: re0: MII without any phy! I traced the mii_phy_probe() function in /sys/dev/mii/mii.c, only to find all the bmsr values read by MIIBUS_READREG was: 0, 0xffff, 0, 0, ... (all 0's) so that mii_phy_probe() did not find any PHY. What's the problem? -- Quan Qiu