From nobody@FreeBSD.org  Sat Aug 31 11:30:27 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id 476CCC05
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 31 Aug 2013 11:30:27 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id E4E7E2B17
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 31 Aug 2013 11:30:26 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r7VBULnd018917
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 31 Aug 2013 11:30:21 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r7VBULMB018911;
	Sat, 31 Aug 2013 11:30:21 GMT
	(envelope-from nobody)
Message-Id: <201308311130.r7VBULMB018911@oldred.freebsd.org>
Date: Sat, 31 Aug 2013 11:30:21 GMT
From: Neel Chauhan <neel@neelc.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Realtek 8111G Ethernet controller not detected
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         181703
>Category:       kern
>Synopsis:       [re] [patch] Fix Realtek 8111G Ethernet controller not being detected
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-net
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug 31 11:40:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Tue Sep 10 23:40:01 UTC 2013
>Originator:     Neel Chauhan
>Release:        FreeBSD 9.1-RELEASE
>Organization:
N/A (High School Student)
>Environment:
FFreeBSD  9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec  4 09:23:10 UTC 2012    root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
When I boot FreeBSD 9.1 with the Realtek 8111G controller on an Asus H87M-E motherboard, it says "Unknown H/W revision".

dmesg snapshot:
re0: <RealTek 8168/8111 B/C/CP/D/DP/E/F PCIe Gigabit Ethernet> port 0xd000-0xd0ff mem 0xf3104000-0xf3104fff,0xf3100000-0xf3103fff irq 18 at device 0.0 on pci3
re0: Using 1 MSI-X message
re0: turning off MSI enable bit.
re0: Chip rev. 0x4c000000
re0: MAC rev. 0x00000000
re0: Unknown H/W revision: 0x4c000000

>How-To-Repeat:
1. Load FreeBSD on a computer with a Realtek 8111G controller
2. See the dmesg output that says that the HW revision is unknown
>Fix:
I did set up patches to support the ethernet controller. The patches are:

--- sys/dev/re/if_re.c.old      2013-08-30 16:40:34.000000000 -0400
+++ sys/dev/re/if_re.c  2013-08-31 07:22:36.000000000 -0400
@@ -233,6 +233,7 @@
        { RL_HWREV_8168E, RL_8169, "8168E/8111E", RL_JUMBO_MTU_9K},
        { RL_HWREV_8168E_VL, RL_8169, "8168E/8111E-VL", RL_JUMBO_MTU_6K},
        { RL_HWREV_8168F, RL_8169, "8168F/8111F", RL_JUMBO_MTU_9K},
+       { RL_HWREV_8168G, RL_8169, "8168G/8111G", RL_JUMBO_MTU_9K},
        { RL_HWREV_8411, RL_8169, "8411", RL_JUMBO_MTU_9K},
        { 0, 0, NULL, 0 }
 };
@@ -1456,6 +1457,7 @@
                break;
        case RL_HWREV_8168E_VL:
        case RL_HWREV_8168F:
+       case RL_HWREV_8168G:
        case RL_HWREV_8411:
                sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR |
                    RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP |


---and---

--- sys/pci/if_rlreg.h.old      2013-08-30 16:45:07.000000000 -0400
+++ /sys/pci/if_rlreg.h 2013-08-30 18:22:11.000000000 -0400
@@ -190,6 +190,7 @@
 #define        RL_HWREV_8105E_SPIN1    0x40C00000
 #define        RL_HWREV_8402           0x44000000
 #define        RL_HWREV_8168F          0x48000000
+#define        RL_HWREV_8168G          0x4c000000
 #define        RL_HWREV_8411           0x48800000
 #define        RL_HWREV_8139           0x60000000
 #define        RL_HWREV_8139A          0x70000000


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Sep 1 04:33:24 UTC 2013 
Responsible-Changed-Why:  

Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=181703 

From: "Neel Chauhan" <neel@neelc.org>
To: bug-followup@FreeBSD.org,
 neel@neelc.org
Cc:  
Subject: Re: kern/181703: [re] [patch] Fix Realtek 8111G Ethernet controller not being detected
Date: Tue, 10 Sep 2013 19:26:23 -0400

 Update: I tested the patch. It just makes the ethernet controller useless
 until you unplug your computer.
>Unformatted:
