更新Linux网卡驱动

我们是博通的网卡,查看博通网卡的驱动版本的命令:
[root@HT101-108 hongtu]# ethtool -i eth0
driver: bnx2
version: 1.7.9-1
firmware-version: 5.2.3 NCSI 2.0.11
bus-info: 0000:01:00.0
我们知道博通网卡的驱动文件名叫bnx2.ko
[root@HT101-108 hongtu]# find /lib/modules -name  bnx2.ko 
/lib/modules/2.6.18-128.el5PAE/kernel/drivers/net/bnx2.ko
查看驱动详细情况:
version记录就是我们的网卡驱动版本,是 1.7.9-1





------------ ------------------- ------------------- ------------------- ------------------- ------------------- ------------------- ----------
更新网卡驱动:


一,源码RPM包安装方式:
[root@lab ~]# rpm -ivh netxtreme2-4.8.10-1.src.rpm             安装源码包
   1:netxtreme2             ########################################### [100%]

2,[root@lab ~]# cd /usr/src/redhat/
[root@lab redhat]# ls
BUILD RPMS SOURCES SPECS SRPMS
[root@lab redhat]# rpmbuild -bb SPECS/netxtreme2.spec

在源码编译结束的时候会看到如下的提示
Wrote: /usr/src/redhat/RPMS/i386/netxtreme2-4.8.10-1.i386.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.59603
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd netxtreme2-4.8.10
+ rm -rf /var/tmp/netxtreme2-buildroot /usr/src/redhat/BUILD/file.list.netxtreme2
+ exit 0                   (如果返回值为1-255,就说明编译没有成功)

3,[root@lab redhat]# rpm -ivh RPMS/i386/netxtreme2-4.8.10-1.i386.rpm           安装编译之后生成的rpm包
Preparing...                ########################################### [100%]
   1:netxtreme2             ########################################### [100%]


[root@lab redhat]# lsmod |grep bnx2           安装后默认没有加载该模块,如果有则rmmod bnx2移除之前的。
[root@lab redhat]# modprobe bnx2                  手动加载,modprober命令会去搜索/lib/modules/2.6.18-53.el5下边所有的包
[root@lab redhat]# lsmod |grep bnx2                再次查看就有了
bnx2                  171400 0




二,tar包安装方法

1,[root@lab ~]# tar zxvf netxtreme2-4.8.10.tar.gz   解压tar.gz包
netxtreme2-4.8.10/
netxtreme2-4.8.10/bnx2
netxtreme2-4.8.10/bnx2-1.8.5b/
。。。。。。。。。。。。。。

2,[root@lab ~]# cd netxtreme2-4.8.10
[root@lab netxtreme2-4.8.10]# ls
bnx2 bnx2-1.8.5b bnx2x bnx2x-1.48.53 INSTALL.TXT Makefile 
此时在这个地方就可以编译了,编译并安装之后会生成三个模块:bnx2.ko,bnx2x.ko,cnic.ko
[root@lab netxtreme2-4.8.10]# make&&make install

3,如果只需要生成bnx2.ko(cnic.ko是附带的)这个模块,可以进入当前目录下边的子目录bnx2/src,然后执行make&&make install
[root@lab src]# pwd
/root/netxtreme2-4.8.10/bnx2/src
[root@lab src]# make;make install   编译并安装
。。。。。。。。。。。。。。。
mkdir -p //lib/modules/2.6.18-53.el5/updates;
install -m 444 bnx2.ko cnic.ko //lib/modules/2.6.18-53.el5/updates;
install -m 444 bnx2.4.gz /usr/share/man/man4;
mkdir -p /usr/src/bnx2;
install -m 644 cnic_if.h cnic_drv.h bnx2.h /usr/src/bnx2;








*******************************分割线******************************

[root@localhost ~]# ethtool -i eth0
driver: tg3
version: 3.116j
firmware-version: sb
bus-info: 0000:07:00.0
[root@localhost ~]# lsmod |grep tg3
tg3                   168724  0 

[root@localhost log]# modinfo tg3
filename:       /lib/modules/2.6.18-164.el5/updates/tg3.ko
firmware:       tigon/tg3_tso5.bin
firmware:       tigon/tg3_tso.bin
firmware:       tigon/tg3.bin
version:        3.116j
[root@localhost ~]#lspci
00:00.0 Host bridge: Intel Corporation 4 Series Chipset DRAM Controller (rev 03)
00:01.0 PCI bridge: Intel Corporation 4 Series Chipset PCI Express Root Port (rev 03)
00:1a.0 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #4
00:1a.1 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #5
00:1a.2 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #6
00:1a.7 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #2
00:1b.0 Audio device: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller
00:1c.0 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Port 1
00:1c.1 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Port 2
00:1c.2 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Port 3
00:1c.3 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Port 4
00:1c.4 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Port 5
00:1c.5 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Port 6
00:1d.0 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #1
00:1d.1 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #2
00:1d.2 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #3
00:1d.7 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #1
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 90)
00:1f.0 ISA bridge: Intel Corporation 82801JIB (ICH10) LPC Interface Controller
00:1f.2 IDE interface: Intel Corporation 82801JI (ICH10 Family) 4 port SATA IDE Controller
00:1f.3 SMBus: Intel Corporation 82801JI (ICH10 Family) SMBus Controller
00:1f.5 IDE interface: Intel Corporation 82801JI (ICH10 Family) 2 port SATA IDE Controller
01:00.0 VGA compatible controller: nVidia Corporation Unknown device 0de1 (rev a1)
01:00.1 Audio device: nVidia Corporation Unknown device 0bea (rev a1)
02:00.0 IDE interface: Marvell Technology Group Ltd. 88SE6101 single-port PATA133 interface (rev b2)
07:00.0 Ethernet controller: Broadcom Corporation NetLink BCM57788 Gigabit Ethernet PCIe (rev 01)

源码包升级驱动
tg3-3.122n.tar.gz
make && make install
cd /lib/modules/2.6.18-164.el5/updates
rmmod tg3
insmod tg3
modprobe tg3
[root@localhost ~]# modinfo tg3
filename:       /lib/modules/2.6.18-164.el5/updates/tg3.ko
firmware:       tigon/tg3_tso5.bin
firmware:       tigon/tg3_tso.bin
firmware:       tigon/tg3.bin
version:        3.122n
license:        GPL
description:    Broadcom Tigon3 ethernet driver

本文出自 “Mr_Z” 博客,请务必保留此出处http://zhangrong.blog.51cto.com/2196532/752876

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值