更新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 查找下bnx2.ko的位置
[root@HT101-108 hongtu]# find /lib/modules -name  bnx2.ko 
/lib/modules/2.6.18-128.el5PAE/kernel/drivers/net/bnx2.ko
查看驱动详细情况:
[root@HT101-108 hongtu]# modinfo /lib/modules/2.6.18-128.el5PAE/kernel/drivers/net/bnx2.ko 
filename:       /lib/modules/2.6.18-128.el5PAE/kernel/drivers/net/bnx2.ko
version:        1.7.9-1
license:        GPL
description:    Broadcom NetXtreme II BCM5706/5708/5709 Driver
author:         Michael Chan <[email protected]>
srcversion:     71574E8CA8E4B7882A0AC73
alias:          pci:v000014E4d0000163Csv*sd*bc*sc*i*
alias:          pci:v000014E4d0000163Bsv*sd*bc*sc*i*
alias:          pci:v000014E4d0000163Asv*sd*bc*sc*i*
alias:          pci:v000014E4d00001639sv*sd*bc*sc*i*
alias:          pci:v000014E4d000016ACsv*sd*bc*sc*i*
alias:          pci:v000014E4d000016AAsv*sd*bc*sc*i*
alias:          pci:v000014E4d000016AAsv0000103Csd00003102bc*sc*i*
alias:          pci:v000014E4d0000164Csv*sd*bc*sc*i*
alias:          pci:v000014E4d0000164Asv*sd*bc*sc*i*
alias:          pci:v000014E4d0000164Asv0000103Csd00003106bc*sc*i*
alias:          pci:v000014E4d0000164Asv0000103Csd00003101bc*sc*i*
depends:        
vermagic:       2.6.18-128.el5PAE SMP mod_unload 686 REGPARM 4KSTACKS gcc-4.1
parm:           disable_msi:Disable Message Signaled Interrupt (MSI) (int)
module_sig:     883f3504949344a31b497468cdd12cf112eee10a08a117472662feb22461926e5d4dddc9b665bdaa0a0a57ea6f45d214f7d64dcd94c761479548fb795ff


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

你可能感兴趣的:(linux,version,网卡驱动,bnx2,ethtool)