Driver Realtek RTL8111B-GR* di FreeBSD

By : mqueue DUA  hari belakangan ini saya direpotkan dengan belum tersedianya module driver  Gigabit (10/100/1000 Mbits/sec) LAN Realtek RTL...

By : mqueue
DUA hari belakangan ini saya direpotkan dengan belum tersedianya module driver Gigabit (10/100/1000 Mbits/sec) LAN Realtek RTL8111B-GR* device di FreeBSD. Pasalnya, sewaktu membeli mainboard Intel D945GCNL saya tidak berpikiran kalau NIC card onboard-nya sudah support gigabit ethernet seperti di atas. 
Setelah upgrade kernel ke versi terbaru, FreeBSD 6.3-PRERELEASE, ternyata module untuk NIC card tersebut belum juga tersedia, alamaaakk... bikin pusing juga, mana sudah didesak sama empunya server harus selesai secepatnya (untung dengan kata "secepatnya" yang berarti belum dilimit kapan batas waktunya, hehehehe).
Beruntung setelah obrak-abrik google, akhirnya ketemu patch versi agak lawas daripada versi module kernel 6.3-PRERELEASE.
Ada dua file yang harus dipatch yaitu if_re.c dan if_rlreg.h. Untuk patchnya sendiri, silakan diubah untuk menyesuaikan dengan source module versi terbaru (karena patch ini dirilis sebelum kernel 6.3-PRERELEASE).
Index: dev/re/if_re.c
===================================================================
RCS file: sys/dev/re/if_re.c,v
retrieving revision 1.95
diff -u -r1.95 if_re.c
--- dev/re/if_re.c      14 Aug 2007 02:00:04 -0000      1.95
+++ dev/re/if_re.c      30 Oct 2007 01:05:06 -0000
@@ -180,6 +180,8 @@
                "RealTek 8168/8111B PCIe Gigabit Ethernet" },
        { RT_VENDORID, RT_DEVICEID_8168, RL_HWREV_8168_SPIN2,
                "RealTek 8168/8111B PCIe Gigabit Ethernet" },
+       { RT_VENDORID, RT_DEVICEID_8168, RL_HWREV_8168_SPIN3,
+               "RealTek 8168/8111B PCIe Gigabit Ethernet" },
        { RT_VENDORID, RT_DEVICEID_8169, RL_HWREV_8169,
                "RealTek 8169 Gigabit Ethernet" },
        { RT_VENDORID, RT_DEVICEID_8169, RL_HWREV_8169S,
@@ -221,6 +223,7 @@
        { RL_HWREV_8100E, RL_8169, "8100E"},
        { RL_HWREV_8101E, RL_8169, "8101E"},
        { RL_HWREV_8168_SPIN2, RL_8169, "8168"},
+       { RL_HWREV_8168_SPIN3, RL_8169, "8168"},
        { 0, 0, NULL }
 };

@@ -676,14 +679,18 @@
         */

        hwrev = CSR_READ_4(sc, RL_TXCFG) & RL_TXCFG_HWREV;
-
-       if (hwrev == RL_HWREV_8100E || hwrev == RL_HWREV_8101E ||
-           hwrev == RL_HWREV_8168_SPIN1 || hwrev == RL_HWREV_8168_SPIN2) {
+       switch (hwrev) {
+       case RL_HWREV_8100E:
+       case RL_HWREV_8101E:
+       case RL_HWREV_8168_SPIN1:
+       case RL_HWREV_8168_SPIN2:
                CSR_WRITE_4(sc, RL_MAR0, bswap32(hashes[1]));
                CSR_WRITE_4(sc, RL_MAR4, bswap32(hashes[0]));
-       } else {
+               break;
+       default:
                CSR_WRITE_4(sc, RL_MAR0, hashes[0]);
                CSR_WRITE_4(sc, RL_MAR4, hashes[1]);
+               break;
        }
 }

@@ -1314,6 +1321,7 @@
                        case RL_HWREV_8169_8110SB:
                        case RL_HWREV_8169_8110SC:
                        case RL_HWREV_8168_SPIN2:
+                       case RL_HWREV_8168_SPIN3:
                                re_gmii_writereg(dev, 1, 0x1f, 0);
                                re_gmii_writereg(dev, 1, 0x0e, 0);
                                break;
Index: pci/if_rlreg.h
===================================================================
RCS file: sys/pci/if_rlreg.h,v
retrieving revision 1.67
diff -u -r1.67 if_rlreg.h
--- pci/if_rlreg.h      24 Jul 2007 01:24:03 -0000      1.67
+++ pci/if_rlreg.h      30 Oct 2007 01:05:07 -0000
@@ -156,6 +156,7 @@
 #define RL_HWREV_8100E         0x30800000
 #define RL_HWREV_8101E         0x34000000
 #define RL_HWREV_8168_SPIN2    0x38000000
+#define RL_HWREV_8168_SPIN3    0x38400000
 #define RL_HWREV_8139          0x60000000
 #define RL_HWREV_8139A         0x70000000
 #define RL_HWREV_8139AG        0x70800000
Setelah recompile kernel, akhirnya module driver tersebut dapat mendeteksi NIC Card dan mengenali NIC tersebut sebagai re.
re0: <RealTek 8168/8111B PCIe Gigabit Ethernet> port 0x2000-0x20ff mem 0xe0100000-0xe0100fff irq 17 at device 0.0 on pci2
miibus0: <MII bus> on re0
re0: Ethernet address: 00:1c:c0:0d:a0:4d
re0: [FAST]
proxy# ifconfig
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=1b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING>
        inet6 fe80::21c:c0ff:fe0d:a04d%re0 prefixlen 64 scopeid 0x1
        inet 192.168.1.99 netmask 0xfffffff8 broadcast 192.168.1.255
        ether 00:1c:c0:0d:a0:4d
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
proxy# ping yahoo.com
PING yahoo.com (66.94.234.13): 56 data bytes
64 bytes from 66.94.234.13: icmp_seq=0 ttl=49 time=268.663 ms
64 bytes from 66.94.234.13: icmp_seq=1 ttl=48 time=244.545 ms
64 bytes from 66.94.234.13: icmp_seq=2 ttl=48 time=272.899 ms

COMMENTS

Name

Application Support,19,database server,1,Desktop/XWindow,1,DNS Server,2,Email Server,3,Firewall,1,FTP Server,2,General,2,IPFilter,1,Kernel,2,Networking,8,Proxy Server,4,Security,6,Tips and Trick,5,Web Server,2,
ltr
item
IndoFreeBSD: Driver Realtek RTL8111B-GR* di FreeBSD
Driver Realtek RTL8111B-GR* di FreeBSD
IndoFreeBSD
http://www.indofreebsd.or.id/2015/02/driver-realtek-rtl8111b-gr-di-freebsd.html
http://www.indofreebsd.or.id/
http://www.indofreebsd.or.id/
http://www.indofreebsd.or.id/2015/02/driver-realtek-rtl8111b-gr-di-freebsd.html
true
1901051463523757307
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content