Linux系统对硬件的识别是以芯片组的厂商为依据的,不是根据硬件的品牌。因为很多硬件厂商的服务器都是组装过来的,他们并没有能力来生产硬件,于是他们从其他硬件厂商把主芯片拿过来,焊接在自己的电路板上,最后对这些产品做的标示,也就是硬件品牌。
在Linux系统中可以使用lspci命令显示连接在PCI总线上的所有硬件,包括网卡的详细信息
[root@YANGJUNJUN ~]# lspci
00:00.0 Host bridge: Intel Corporation 82945G/GZ/P/PL Memory Controller Hub (rev 02)
00:02.0 VGA compatible controller: Intel Corporation 82945G/GZ Integrated Graphics Controller (rev 02)
00:1c.0 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 1 (rev 01)
00:1c.1 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 2 (rev 01)
00:1d.0 USB Controller: Intel Corporation N10/ICH7 Family USB UHCI Controller #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #3 (rev 01)
00:1d.3 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #4 (rev 01)
00:1d.7 USB Controller: Intel Corporation N10/ICH 7 Family USB2 EHCI Controller (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1)
00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge (rev 01)
00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01)
00:1f.2 IDE interface: Intel Corporation N10/ICH7 Family SATA IDE Controller (rev 01)
00:1f.3 SMBus: Intel Corporation N10/ICH 7 Family SMBus Controller (rev 01)
01:01.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
02:00.0 Ethernet controller: Atheros Communications L2 100 Mbit Ethernet Adapter (rev a0)
从上面的结果看出,本机是拥有两块网卡
00:00.0 Host bridge: Intel Corporation 82945G/GZ/P/PL Memory Controller Hub (rev 02)
00:02.0 VGA compatible controller: Intel Corporation 82945G/GZ Integrated Graphics Controller (rev 02)
00:1c.0 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 1 (rev 01)
00:1c.1 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 2 (rev 01)
00:1d.0 USB Controller: Intel Corporation N10/ICH7 Family USB UHCI Controller #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #3 (rev 01)
00:1d.3 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #4 (rev 01)
00:1d.7 USB Controller: Intel Corporation N10/ICH 7 Family USB2 EHCI Controller (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1)
00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge (rev 01)
00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01)
00:1f.2 IDE interface: Intel Corporation N10/ICH7 Family SATA IDE Controller (rev 01)
00:1f.3 SMBus: Intel Corporation N10/ICH 7 Family SMBus Controller (rev 01)
01:01.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
02:00.0 Ethernet controller: Atheros Communications L2 100 Mbit Ethernet Adapter (rev a0)
从上面的结果看出,本机是拥有两块网卡
在Linux系统中,本身提供了很多网卡驱动,它存放的目录是/lib/modules/2.6.18-53.e15/kernel/drivers/net/
[root@YANGJUNJUN ~]# ll /lib/modules/2.6.18-194.el5/kernel/drivers/net
total 3344
-rwxr--r-- 1 root root 58748 Apr 3 2010 3c59x.ko
-rwxr--r-- 1 root root 30984 Apr 3 2010 8139cp.ko
-rwxr--r-- 1 root root 36736 Apr 3 2010 8139too.ko
-rwxr--r-- 1 root root 16196 Apr 3 2010 8390.ko
-rwxr--r-- 1 root root 253992 Apr 3 2010 acenic.ko
-rwxr--r-- 1 root root 28872 Apr 3 2010 amd8111e.ko
-rwxr--r-- 1 root root 33424 Apr 3 2010 b44.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 benet
-rwxr--r-- 1 root root 187620 Apr 3 2010 bnx2.ko
-rwxr--r-- 1 root root 608300 Apr 3 2010 bnx2x.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 bonding
-rwxr--r-- 1 root root 59464 Apr 3 2010 cassini.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 chelsio
-rwxr--r-- 1 root root 50456 Apr 3 2010 cnic.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 cxgb3
-rwxr--r-- 1 root root 31936 Apr 3 2010 dl2k.ko
-rwxr--r-- 1 root root 8932 Apr 3 2010 dummy.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 e1000
drwxr-xr-x 2 root root 4096 Sep 25 18:10 e1000e
-rwxr--r-- 1 root root 44944 Apr 3 2010 e100.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 enic
-rwxr--r-- 1 root root 27756 Apr 3 2010 epic100.ko
-rwxr--r-- 1 root root 28528 Apr 3 2010 fealnx.ko
-rwxr--r-- 1 root root 65484 Apr 3 2010 forcedeth.ko
-rwxr--r-- 1 root root 11072 Apr 3 2010 ifb.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 igb
drwxr-xr-x 2 root root 4096 Sep 25 18:10 igbvf
drwxr-xr-x 2 root root 4096 Sep 25 18:10 ixgb
drwxr-xr-x 2 root root 4096 Sep 25 18:10 ixgbe
drwxr-xr-x 2 root root 4096 Sep 25 18:10 ixgbevf
-rwxr--r-- 1 root root 10668 Apr 3 2010 mdio.ko
-rwxr--r-- 1 root root 11060 Apr 3 2010 mii.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 mlx4
drwxr-xr-x 2 root root 4096 Sep 25 18:10 myri10ge
-rwxr--r-- 1 root root 34540 Apr 3 2010 natsemi.ko
-rwxr--r-- 1 root root 18128 Apr 3 2010 ne2k-pci.ko
-rwxr--r-- 1 root root 8772 Apr 3 2010 netconsole.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 netxen
-rwxr--r-- 1 root root 84908 Apr 3 2010 niu.ko
-rwxr--r-- 1 root root 26276 Apr 3 2010 ns83820.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 pcmcia
-rwxr--r-- 1 root root 42876 Apr 3 2010 pcnet32.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 phy
-rwxr--r-- 1 root root 17924 Apr 3 2010 ppp_async.ko
-rwxr--r-- 1 root root 11864 Apr 3 2010 ppp_deflate.ko
-rwxr--r-- 1 root root 36140 Apr 3 2010 ppp_generic.ko
-rwxr--r-- 1 root root 12824 Apr 3 2010 ppp_mppe.ko
-rwxr--r-- 1 root root 24260 Apr 3 2010 pppoe.ko
-rwxr--r-- 1 root root 9488 Apr 3 2010 pppox.ko
-rwxr--r-- 1 root root 16192 Apr 3 2010 ppp_synctty.ko
-rwxr--r-- 1 root root 42192 Apr 3 2010 qla3xxx.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 qlge
-rwxr--r-- 1 root root 50484 Apr 3 2010 r8169.ko
-rwxr--r-- 1 root root 100592 Apr 3 2010 s2io.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 sfc
-rwxr--r-- 1 root root 28016 Apr 3 2010 sis190.ko
-rwxr--r-- 1 root root 30496 Apr 3 2010 sis900.ko
-rwxr--r-- 1 root root 44560 Apr 3 2010 skge.ko
-rwxr--r-- 1 root root 57916 Apr 3 2010 sky2.ko
-rwxr--r-- 1 root root 12100 Apr 3 2010 slhc.ko
-rwxr--r-- 1 root root 20172 Apr 3 2010 slip.ko
-rwxr--r-- 1 root root 33680 Apr 3 2010 starfire.ko
-rwxr--r-- 1 root root 31964 Apr 3 2010 sundance.ko
-rwxr--r-- 1 root root 36676 Apr 3 2010 sungem.ko
-rwxr--r-- 1 root root 15760 Apr 3 2010 sungem_phy.ko
-rwxr--r-- 1 root root 30636 Apr 3 2010 sunhme.ko
-rwxr--r-- 1 root root 138848 Apr 3 2010 tg3.ko
-rwxr--r-- 1 root root 37828 Apr 3 2010 tlan.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 tokenring
drwxr-xr-x 2 root root 4096 Sep 25 18:10 tulip
-rwxr--r-- 1 root root 24588 Apr 3 2010 tun.ko
-rwxr--r-- 1 root root 82092 Apr 3 2010 typhoon.ko
-rwxr--r-- 1 root root 33684 Apr 3 2010 via-rhine.ko
-rwxr--r-- 1 root root 41708 Apr 3 2010 via-velocity.ko
-rwxr--r-- 1 root root 19536 Apr 3 2010 virtio_net.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 vxge
drwxr-xr-x 10 root root 4096 Sep 25 18:10 wireless
上面,以.ko结尾的就是网卡驱动程序,其他文件是驱动程序的目录,一般情况下,broadcom芯片对应的驱动程序名类似tg3.ko、bnx2.ko和bcm57xx等,Inter芯片的驱动程序类似 e1000.ko 、e1000e.ko ,VIA芯片的驱动程序类似 via-rhine.ko 、via-velocity.ko 等,RealTek芯片的驱动程序类似8139cp.ko 、8139too.ko等。
total 3344
-rwxr--r-- 1 root root 58748 Apr 3 2010 3c59x.ko
-rwxr--r-- 1 root root 30984 Apr 3 2010 8139cp.ko
-rwxr--r-- 1 root root 36736 Apr 3 2010 8139too.ko
-rwxr--r-- 1 root root 16196 Apr 3 2010 8390.ko
-rwxr--r-- 1 root root 253992 Apr 3 2010 acenic.ko
-rwxr--r-- 1 root root 28872 Apr 3 2010 amd8111e.ko
-rwxr--r-- 1 root root 33424 Apr 3 2010 b44.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 benet
-rwxr--r-- 1 root root 187620 Apr 3 2010 bnx2.ko
-rwxr--r-- 1 root root 608300 Apr 3 2010 bnx2x.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 bonding
-rwxr--r-- 1 root root 59464 Apr 3 2010 cassini.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 chelsio
-rwxr--r-- 1 root root 50456 Apr 3 2010 cnic.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 cxgb3
-rwxr--r-- 1 root root 31936 Apr 3 2010 dl2k.ko
-rwxr--r-- 1 root root 8932 Apr 3 2010 dummy.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 e1000
drwxr-xr-x 2 root root 4096 Sep 25 18:10 e1000e
-rwxr--r-- 1 root root 44944 Apr 3 2010 e100.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 enic
-rwxr--r-- 1 root root 27756 Apr 3 2010 epic100.ko
-rwxr--r-- 1 root root 28528 Apr 3 2010 fealnx.ko
-rwxr--r-- 1 root root 65484 Apr 3 2010 forcedeth.ko
-rwxr--r-- 1 root root 11072 Apr 3 2010 ifb.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 igb
drwxr-xr-x 2 root root 4096 Sep 25 18:10 igbvf
drwxr-xr-x 2 root root 4096 Sep 25 18:10 ixgb
drwxr-xr-x 2 root root 4096 Sep 25 18:10 ixgbe
drwxr-xr-x 2 root root 4096 Sep 25 18:10 ixgbevf
-rwxr--r-- 1 root root 10668 Apr 3 2010 mdio.ko
-rwxr--r-- 1 root root 11060 Apr 3 2010 mii.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 mlx4
drwxr-xr-x 2 root root 4096 Sep 25 18:10 myri10ge
-rwxr--r-- 1 root root 34540 Apr 3 2010 natsemi.ko
-rwxr--r-- 1 root root 18128 Apr 3 2010 ne2k-pci.ko
-rwxr--r-- 1 root root 8772 Apr 3 2010 netconsole.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 netxen
-rwxr--r-- 1 root root 84908 Apr 3 2010 niu.ko
-rwxr--r-- 1 root root 26276 Apr 3 2010 ns83820.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 pcmcia
-rwxr--r-- 1 root root 42876 Apr 3 2010 pcnet32.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 phy
-rwxr--r-- 1 root root 17924 Apr 3 2010 ppp_async.ko
-rwxr--r-- 1 root root 11864 Apr 3 2010 ppp_deflate.ko
-rwxr--r-- 1 root root 36140 Apr 3 2010 ppp_generic.ko
-rwxr--r-- 1 root root 12824 Apr 3 2010 ppp_mppe.ko
-rwxr--r-- 1 root root 24260 Apr 3 2010 pppoe.ko
-rwxr--r-- 1 root root 9488 Apr 3 2010 pppox.ko
-rwxr--r-- 1 root root 16192 Apr 3 2010 ppp_synctty.ko
-rwxr--r-- 1 root root 42192 Apr 3 2010 qla3xxx.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 qlge
-rwxr--r-- 1 root root 50484 Apr 3 2010 r8169.ko
-rwxr--r-- 1 root root 100592 Apr 3 2010 s2io.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 sfc
-rwxr--r-- 1 root root 28016 Apr 3 2010 sis190.ko
-rwxr--r-- 1 root root 30496 Apr 3 2010 sis900.ko
-rwxr--r-- 1 root root 44560 Apr 3 2010 skge.ko
-rwxr--r-- 1 root root 57916 Apr 3 2010 sky2.ko
-rwxr--r-- 1 root root 12100 Apr 3 2010 slhc.ko
-rwxr--r-- 1 root root 20172 Apr 3 2010 slip.ko
-rwxr--r-- 1 root root 33680 Apr 3 2010 starfire.ko
-rwxr--r-- 1 root root 31964 Apr 3 2010 sundance.ko
-rwxr--r-- 1 root root 36676 Apr 3 2010 sungem.ko
-rwxr--r-- 1 root root 15760 Apr 3 2010 sungem_phy.ko
-rwxr--r-- 1 root root 30636 Apr 3 2010 sunhme.ko
-rwxr--r-- 1 root root 138848 Apr 3 2010 tg3.ko
-rwxr--r-- 1 root root 37828 Apr 3 2010 tlan.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 tokenring
drwxr-xr-x 2 root root 4096 Sep 25 18:10 tulip
-rwxr--r-- 1 root root 24588 Apr 3 2010 tun.ko
-rwxr--r-- 1 root root 82092 Apr 3 2010 typhoon.ko
-rwxr--r-- 1 root root 33684 Apr 3 2010 via-rhine.ko
-rwxr--r-- 1 root root 41708 Apr 3 2010 via-velocity.ko
-rwxr--r-- 1 root root 19536 Apr 3 2010 virtio_net.ko
drwxr-xr-x 2 root root 4096 Sep 25 18:10 vxge
drwxr-xr-x 10 root root 4096 Sep 25 18:10 wireless
上面,以.ko结尾的就是网卡驱动程序,其他文件是驱动程序的目录,一般情况下,broadcom芯片对应的驱动程序名类似tg3.ko、bnx2.ko和bcm57xx等,Inter芯片的驱动程序类似 e1000.ko 、e1000e.ko ,VIA芯片的驱动程序类似 via-rhine.ko 、via-velocity.ko 等,RealTek芯片的驱动程序类似8139cp.ko 、8139too.ko等。
使用lsmod命令查看当前系统加载的模块信息
[root@YANGJUNJUN ~]# lsmod
Module Size Used by
autofs4 29253 3
hidp 23105 2
rfcomm 42457 0
l2cap 29505 10 hidp,rfcomm
bluetooth 53925 5 hidp,rfcomm,l2cap
lockd 63337 0
sunrpc 146685 2 lockd
ipv6 270305 24
xfrm_nalgo 13381 1 ipv6
crypto_api 12609 1 xfrm_nalgo
cpufreq_ondemand 12493 1
acpi_cpufreq 13897 1
loop 18761 0
dm_mirror 24393 0
dm_multipath 25421 0
scsi_dh 12097 1 dm_multipath
video 21192 0
backlight 10049 1 video
sbs 18533 0
power_meter 16461 0
hwmon 7365 1 power_meter
i2c_ec 9025 1 sbs
dell_wmi 8401 0
wmi 12137 1 dell_wmi
button 10705 0
battery 13637 0
asus_acpi 19289 0
ac 9157 0
parport_pc 29157 0
lp 15849 0
parport 37513 2 parport_pc,lp
sg 36573 0
pcspkr 7104 0
8139too 28993 0
ide_cd 40161 0
8139cp 26433 0
i2c_i801 11725 0
i2c_core 24001 2 i2c_ec,i2c_i801
serio_raw 10693 0
mii 9409 2 8139too,8139cp
cdrom 36577 1 ide_cd
dm_raid45 67145 0
dm_message 6977 1 dm_raid45
dm_region_hash 15681 1 dm_raid45
dm_log 14657 3 dm_mirror,dm_raid45,dm_region_hash
dm_mod 63225 4 dm_mirror,dm_multipath,dm_raid45,dm_log
dm_mem_cache 9537 1 dm_raid45
ata_piix 23621 3
libata 157317 1 ata_piix
sd_mod 25281 4
scsi_mod 141973 4 scsi_dh,sg,libata,sd_mod
ext3 125513 2
jbd 57321 1 ext3
uhci_hcd 25421 0
ohci_hcd 25065 0
ehci_hcd 33869 0
从上面看8139too、8139cp 就是本机上两块RealTek的网卡驱动模块了
Module Size Used by
autofs4 29253 3
hidp 23105 2
rfcomm 42457 0
l2cap 29505 10 hidp,rfcomm
bluetooth 53925 5 hidp,rfcomm,l2cap
lockd 63337 0
sunrpc 146685 2 lockd
ipv6 270305 24
xfrm_nalgo 13381 1 ipv6
crypto_api 12609 1 xfrm_nalgo
cpufreq_ondemand 12493 1
acpi_cpufreq 13897 1
loop 18761 0
dm_mirror 24393 0
dm_multipath 25421 0
scsi_dh 12097 1 dm_multipath
video 21192 0
backlight 10049 1 video
sbs 18533 0
power_meter 16461 0
hwmon 7365 1 power_meter
i2c_ec 9025 1 sbs
dell_wmi 8401 0
wmi 12137 1 dell_wmi
button 10705 0
battery 13637 0
asus_acpi 19289 0
ac 9157 0
parport_pc 29157 0
lp 15849 0
parport 37513 2 parport_pc,lp
sg 36573 0
pcspkr 7104 0
8139too 28993 0
ide_cd 40161 0
8139cp 26433 0
i2c_i801 11725 0
i2c_core 24001 2 i2c_ec,i2c_i801
serio_raw 10693 0
mii 9409 2 8139too,8139cp
cdrom 36577 1 ide_cd
dm_raid45 67145 0
dm_message 6977 1 dm_raid45
dm_region_hash 15681 1 dm_raid45
dm_log 14657 3 dm_mirror,dm_raid45,dm_region_hash
dm_mod 63225 4 dm_mirror,dm_multipath,dm_raid45,dm_log
dm_mem_cache 9537 1 dm_raid45
ata_piix 23621 3
libata 157317 1 ata_piix
sd_mod 25281 4
scsi_mod 141973 4 scsi_dh,sg,libata,sd_mod
ext3 125513 2
jbd 57321 1 ext3
uhci_hcd 25421 0
ohci_hcd 25065 0
ehci_hcd 33869 0
从上面看8139too、8139cp 就是本机上两块RealTek的网卡驱动模块了
转载于:https://blog.51cto.com/nameyjj/402782