From owner-freebsd-hardware@FreeBSD.ORG Mon Aug 14 09:22:44 2006 Return-Path: X-Original-To: freebsd-hardware@freebsd.org Delivered-To: freebsd-hardware@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2A88F16A4DE for ; Mon, 14 Aug 2006 09:22:44 +0000 (UTC) (envelope-from dinesh@alphaque.com) Received: from ns2.alphaque.com (ns2.alphaque.com [202.75.47.153]) by mx1.FreeBSD.org (Postfix) with SMTP id 7F97C43D46 for ; Mon, 14 Aug 2006 09:22:41 +0000 (GMT) (envelope-from dinesh@alphaque.com) Received: (qmail 71035 invoked by uid 0); 14 Aug 2006 09:22:39 -0000 Received: from lucifer.net-gw.com (HELO prophet.alphaque.com) (202.75.47.153) by lucifer.net-gw.com with SMTP; 14 Aug 2006 09:22:39 -0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) by prophet.alphaque.com (8.13.6/8.13.4) with ESMTP id k7E9MNv8032973; Mon, 14 Aug 2006 17:22:23 +0800 (MYT) (envelope-from dinesh@alphaque.com) Message-ID: <44E040CF.9080205@alphaque.com> Date: Mon, 14 Aug 2006 17:22:23 +0800 From: Dinesh Nair User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8b) Gecko/20060213 MIME-Version: 1.0 To: freebsd-hardware@freebsd.org, freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Unable to get RealTek 8139C+ to work with re(4) under FreeBSD 6.1 X-BeenThere: freebsd-hardware@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General discussion of FreeBSD hardware List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 09:22:44 -0000 i've got a single board computer with VIA C3 Samuel 2, 256MB RAM and 4 onboard Realtek 8139C+ NICs. I'm attempting to get FreeBSD 6.1-STABLE working on them, but the realtek NICs just don't seem to want to work. booting up led to a kernel trap with the following, rlphy0: on miibus0 rlphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto re0: Ethernet address: 00:60:e0:e1:21:d7 re0: diagnostic failed, failed to receive packet in loopback mode re0: attach aborted due to hardware diag failure kernel trap 12 with interrupts disabled Fatal trap 12: page fault while in kernel mode fault virtual address = 0x74 fault code = supervisor read, page not present instruction pointer = 0x20:0xc0625d45 stack pointer = 0x28:0xc2420a50 frame pointer = 0x28:0xc2420a54 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, def32 1, gran 1 processor eflags = resume, IOPL = 0 current process = 0 (swapper) trap number = 12 panic: page fault Uptime: 1s looking through /usr/src/sys/dev/re/if_re.c, and reading this thread, http://lists.freebsd.org/pipermail/freebsd-current/2004-June/029373.html, i've patched if_re.c to skip the re_diag() routine if the NIC is not a Realtek 8169. the patch follows, ----- CUT HERE ----- --- if_re.c.orig Mon Aug 14 14:43:05 2006 +++ if_re.c Mon Aug 14 14:42:16 2006 @@ -1235,12 +1235,14 @@ ether_ifattach(ifp, eaddr); /* Perform hardware diagnostic. */ - error = re_diag(sc); + if (sc->rl_type == RL_8169) { + error = re_diag(sc); - if (error) { - device_printf(dev, "attach aborted due to hardware diag failure\n"); - ether_ifdetach(ifp); - goto fail; + if (error) { + device_printf(dev, "attach aborted due to hardware diag failure\n"); + ether_ifdetach(ifp); + goto fail; + } } /* Hook interrupt last to avoid having to lock softc */ ----- CUT HERE ----- with the patch applied, the kernel trap goes away and the box boots up. however, though the link light comes on, the device is effectively unuseable for ethernet traffic. nothing seems to go in or out of the device with ping and other tcp/udp traffic failing. note the media state and the missing status line from the ifconfig output. any clue as to what's happenning here or to pointers/patches to fix this would be much appreciated. i've got the box sitting beside me, so testing patches et al would be highly possible. dmesg, ifconfig and pciconf outputs are as follows: re0: port 0xe300-0xe3ff mem 0xed800000-0xed8000ff irq 5 at device 16.0 on pci0 miibus0: on re0 rlphy0: on miibus0 rlphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto re0: Ethernet address: 00:60:e0:e1:21:d7 re1: port 0xe400-0xe4ff mem 0xed801000-0xed8010ff irq 12 at device 17.0 on pci0 miibus1: on re1 rlphy1: on miibus1 rlphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto re1: Ethernet address: 00:60:e0:e1:21:d6 re2: port 0xe500-0xe5ff mem 0xed802000-0xed8020ff irq 10 at device 18.0 on pci0 miibus2: on re2 rlphy2: on miibus2 rlphy2: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto re2: Ethernet address: 00:60:e0:e1:21:d5 re3: port 0xe600-0xe6ff mem 0xed803000-0xed8030ff irq 11 at device 19.0 on pci0 miibus3: on re3 rlphy3: on miibus3 rlphy3: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto re3: Ethernet address: 00:60:e0:e1:21:d4 # ifconfig -a re0: flags=8843 mtu 1500 options=18 inet 192.168.1.141 netmask 0xffffff00 broadcast 192.168.1.255 ether 00:60:e0:e1:21:d7 media: Ethernet autoselect (none) re1: flags=8843 mtu 1500 options=18 inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255 ether 00:60:e0:e1:21:d6 media: Ethernet autoselect (none) re2: flags=8802 mtu 1500 options=18 ether 00:60:e0:e1:21:d5 media: Ethernet autoselect (none) re3: flags=8802 mtu 1500 options=18 ether 00:60:e0:e1:21:d4 media: Ethernet autoselect (none) # pciconf -l -v re0@pci0:16:0: class=0x020000 card=0x813910ec chip=0x813910ec rev=0x20 hdr=0x00 class = network subclass = ethernet re1@pci0:17:0: class=0x020000 card=0x813910ec chip=0x813910ec rev=0x20 hdr=0x00 class = network subclass = ethernet re2@pci0:18:0: class=0x020000 card=0x813910ec chip=0x813910ec rev=0x20 hdr=0x00 class = network subclass = ethernet re3@pci0:19:0: class=0x020000 card=0x813910ec chip=0x813910ec rev=0x20 hdr=0x00 class = network subclass = ethernet -- Regards, /\_/\ "All dogs go to heaven." dinesh@alphaque.com (0 0) http://www.openmalaysiablog.com/ +==========================----oOO--(_)--OOo----==========================+ | for a in past present future; do | | for b in clients employers associates relatives neighbours pets; do | | echo "The opinions here in no way reflect the opinions of my $a $b." | | done; done | +=========================================================================+