FreeBSD安装RTL8169sc网卡驱动

RELTEK网卡驱动下载:
http://www.realtek.com/downloads/downloadsView.aspx?Langid=1&PNid=13&PFid=5&Level=5&Conn=4&DownTypeID=3&GetDown=false

驱动包中提供了如下安装方法:

=================================================================================
= Realtek 8169S/8169SB/8169SC/8168B/8168C/8168CP/8168D/8168E/ =
= 8101E/8102E/8103E/8401E/8105E Driver =
= for FreeBSD v4.x/5.x/6.x/7.x/8.x/9.x =
=================================================================================

This driver is modified by Realtek Semiconductor corp. and it has been tested OK
on FreeBSD v5.4, FreeBSD v6.4, FreeBSD v7.3, FreeBSD v8.0, and FreeBSD v9.0. To
update the driver, you may use method 1. If method 1 failed, you must use method 2
which is more complex.

Method 1:
1.Copy if_re.ko in "modules" directory to "/modules" directory and overwrite
the existing file.
2.Modify the file "/boot/defaults/loader.conf" and set "if_re_load" in "Network
drivers" section to "Yes"
3.Reboot.

Method 2:
Because the FreeBSD kernel has default drivers to support RTL8139C and RTL8169S. To use the RTL8139C+, RTL8169SB, RTL8169SC, RTL8168B, and RTL8101E, you need to update your NIC driver by recompiling your FreeBSD kernel.

The main steps you have to do:(FreeBSDSrcDir means the directory of FreeBSD source code
and it may be "/usr/src/sys")

  1. keep the orginal driver source code:
  # cd /usr/src/sys/dev/re
  # cp if_re.c if_re.c.org
  
  # cd /usr/src/sys/modules
  # cp Makefile Makefile.org
  
  # cd /usr/src/sys/modules/re
  # cp Makefile Makefile.org
  
  # cd /usr/src/sys/i386/conf/
  # cp GENERIC GENERIC.org
  1. recompile your kernel (you must install your FreeBSD source code first !!)
# vim /usr/src/sys/i386/conf/GENERIC and delete re                  (需要安装VIM,删除或注释文件里的device re行)
# vim /usr/src/sys/modules/Makefile and delete re                     (删除re \行,必须整行删除,不能只删除该行的内容,留一空行,否则后面编译时会报错)
# cd /usr/src/sys/i386/conf
# /usr/sbin/config GENERIC

(for FreeBSD 5.x/6.x/7.x/8.x/9.x)
# cd ../compile/GENERIC
(for FreeBSD 4.x)
# cd http://www.cnblogs.com/compile/GENERIC

# make cleandepend
# make depend
# make                                  (编译时间比较长,大约20Min+)
# make install
# reboot
  1. update the driver source code:
    Copy the dirver source code( if_re.c and if_rereg.h) into /usr/src/sys/dev/re
    Copy the Makefile into /usr/src/sys/modules/re

  2. build the driver:

  # cd /usr/src/sys/modules/re
 # make clean
 # make
  1. install the driver
   # cd /usr/src/sys/modules/re
   # kldload ./if_re.ko                   (载入新的网卡驱动)
   用kldload载入驱动文件,只能一次生效,下次重启系统时,仍然需要手动加载;
   可以采用以下方式,让系统启动时自动载入该网卡驱动:
   #cp  /usr/src/sys/modules/re/if_re.ko /boot/modules/if_re.ko
   #ee /boot/loader.conf     输入if_re_load="YES"
   这样下次重启系统时,就会自动载入网卡驱动。
  1. configurate the static IP address
  # ifconfig re0 xxx.xxx.xxx.xxx
  1. configurate the IP address by DHCP
# /sbin/dhclient re0

The user can use the following command to change link speed and duplexmode.
1. For auto negotiation,
#ifconfig re<device_num> media autoselect

2. For 1000Mbps full-duplex,
#ifconfig re<device_num> media 1000baseTX mediaopt full-duplex

3. For 100Mbps full-duplex,
#ifconfig re<device_num> media 100baseTX mediaopt full-duplex

4. For 100Mbps half-duplex,
#ifconfig re<device_num> media 100baseTX -mediaopt full-duplex

5. For 10Mbps full-duplex,
#ifconfig re<device_num> media 10baseT/UTP mediaopt full-duplex

6. For 10Mbps half-duplex,
#ifconfig re<device_num> media 10baseT/UTP -mediaopt full-duplex
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,418评论 0 10
  • 冬天天气很冷,连太阳都起得越来越晚了。但是我还要准时起床送娃上学,每当闹钟响起时都觉得自己才刚睡着呢,真想...
    清谷幽灵阅读 247评论 0 1
  • 1:如果厨房未有单子,但前面要求做出来,请问你会怎么处理 2:假如我们的霸王粥里面少了一样材料那么你是怎么做的 3...
    金方东阅读 452评论 0 0
  • 棍棒教育,这里泛指用打骂等严厉手段惩罚孩子的一种教育方式。作为心理咨询师,我发现很多成年人的各种心理问题,大都来自...
    心理师静怡阅读 1,155评论 4 5
  • 今晚听Hellen老师关于生命数字2的分享,在爱中遇见自己。 关于爱,每个人都有很多自己的理解和经历。而爱自己必定...
    小飞侠303阅读 454评论 2 3