通过lspci如何找到驱动

通过lspci如何找到驱动?

linux上面的硬件没有驱动,如何找驱动呢?比如一块光纤卡没有驱动。
首先要取得lspci信息,知道光纤卡的相关信息 

root@localhost /]# lspci
0e:00.0 Fibre Channel: QLogic Corp.: Unknown device 2432 (rev 03)

这个Unknow device就是光纤卡Fibre Channel,而且是QLogic的光纤卡。前面的硬件id需要知道0e:00.0。
然后使用lspci -nv参数继续取信息

 

[root@localhost /]# lspci -nv
0e:00.0 Class 0c04: 1077:2432 (rev 03)
Subsystem: 103c:7040
Flags: bus master, fast devsel, latency 0, IRQ 177
I/O ports at 5000 [size=256]
Memory at fdff0000 (64-bit, non-prefetchable) [size=16K]
Capabilities: [44] Power Management version 2
Capabilities: [4c] Express Endpoint IRQ 0
Capabilities: [64] Message Signalled Interrupts: 64bit+ Queue=0/4 Enable-
Capabilities: [74] Vital Product Data
Capabilities: [7c] MSI-X: Enable- Mask- TabSize=16
Capabilities: [100] Advanced Error Reporting
Capabilities: [138] Power Budgeting

0e:00.0可以确定光纤卡的信息是如上部分,其中总要的是“1077:2432”。
在系统中有一个文件/usr/share/hwdata/pcitable,这个文件中存放这系统所有支持和不支持的硬件信息。其中1077代表的厂家QLogic,2432是卡的型号。
那么,现在我拿到一个驱动包,里面有很多模块,到底这个包里的模块是否支持这块卡?到底哪个模块支持这个卡呢?

 

[root@rac01 ~]# tar xvfz qla2xxx-8.01.60-dc5-ia32.tgz
lib/
lib/modules/
lib/modules/2.6.9-11.19AXhugemem/
lib/modules/2.6.9-11.19AXhugemem/kernel/
lib/modules/2.6.9-11.19AXhugemem/kernel/drivers/
lib/modules/2.6.9-11.19AXhugemem/kernel/drivers/scsi/
lib/modules/2.6.9-11.19AXhugemem/kernel/drivers/scsi/qla2xxx/
lib/modules/2.6.9-11.19AXhugemem/kernel/drivers/scsi/qla2xxx/qla6312.ko
lib/modules/2.6.9-11.19AXhugemem/kernel/drivers/scsi/qla2xxx/qla2300.ko
lib/modules/2.6.9-11.19AXhugemem/kernel/drivers/scsi/qla2xxx/qla2100.ko
lib/modules/2.6.9-11.19AXhugemem/kernel/drivers/scsi/qla2xxx/qla2xxx.ko
lib/modules/2.6.9-11.19AXhugemem/kernel/drivers/scsi/qla2xxx/qla2322.ko
lib/modules/2.6.9-11.19AXhugemem/kernel/drivers/scsi/qla2xxx/qla2xxx_conf.ko
lib/modules/2.6.9-11.19AXhugemem/kernel/drivers/scsi/qla2xxx/qla2200.ko
lib/modules/2.6.9-11.19AXhugemem/kernel/drivers/scsi/qla2xxx/qla2xip.ko
lib/modules/2.6.9-11.19AX/
lib/modules/2.6.9-11.19AX/kernel/
lib/modules/2.6.9-11.19AX/kernel/drivers/
lib/modules/2.6.9-11.19AX/kernel/drivers/scsi/
lib/modules/2.6.9-11.19AX/kernel/drivers/scsi/qla2xxx/
lib/modules/2.6.9-11.19AX/kernel/drivers/scsi/qla2xxx/qla6312.ko
lib/modules/2.6.9-11.19AX/kernel/drivers/scsi/qla2xxx/qla2300.ko
lib/modules/2.6.9-11.19AX/kernel/drivers/scsi/qla2xxx/qla2100.ko
lib/modules/2.6.9-11.19AX/kernel/drivers/scsi/qla2xxx/qla2xxx.ko
lib/modules/2.6.9-11.19AX/kernel/drivers/scsi/qla2xxx/qla2322.ko
lib/modules/2.6.9-11.19AX/kernel/drivers/scsi/qla2xxx/qla2xxx_conf.ko
lib/modules/2.6.9-11.19AX/kernel/drivers/scsi/qla2xxx/qla2200.ko
lib/modules/2.6.9-11.19AX/kernel/drivers/scsi/qla2xxx/qla2xip.ko
lib/modules/2.6.9-11.19AXsmp/
lib/modules/2.6.9-11.19AXsmp/kernel/
lib/modules/2.6.9-11.19AXsmp/kernel/drivers/
lib/modules/2.6.9-11.19AXsmp/kernel/drivers/scsi/
lib/modules/2.6.9-11.19AXsmp/kernel/drivers/scsi/qla2xxx/
lib/modules/2.6.9-11.19AXsmp/kernel/drivers/scsi/qla2xxx/qla6312.ko
lib/modules/2.6.9-11.19AXsmp/kernel/drivers/scsi/qla2xxx/qla2300.ko
lib/modules/2.6.9-11.19AXsmp/kernel/drivers/scsi/qla2xxx/qla2100.ko
lib/modules/2.6.9-11.19AXsmp/kernel/drivers/scsi/qla2xxx/qla2xxx.ko
lib/modules/2.6.9-11.19AXsmp/kernel/drivers/scsi/qla2xxx/qla2322.ko
lib/modules/2.6.9-11.19AXsmp/kernel/drivers/scsi/qla2xxx/qla2xxx_conf.ko
lib/modules/2.6.9-11.19AXsmp/kernel/drivers/scsi/qla2xxx/qla2200.ko
lib/modules/2.6.9-11.19AXsmp/kernel/drivers/scsi/qla2xxx/qla2xip.ko
 

[root@rac01 ~]# ls lib/modules/2.6.9-11.19AXsmp/kernel/drivers/scsi/qla2xxx
qla2100.ko  qla2300.ko  qla2xip.ko       qla2xxx.ko
qla2200.ko  qla2322.ko  qla2xxx_conf.ko  qla6312.ko

现在这8个模块,到底是否支持,需要我们看每个模块的信息。首先从qla2xxx开始吧。

[root@rac01 qla2xxx]# modinfo qla2xxx.ko
filename: qla2xxx.ko
parm: ql2xmaxqdepth:Maximum queue depth to report for target devices.
parm: ql2xlogintimeout:Login timeout value in seconds.
parm: qlport_down_retry:Maximum number of command retries to a port that returnsa PORT-DOWN status.
parm: ql2xretrycount:Maximum number of mid-layer retries allowed for a command. Default value is 20,
parm: displayConfig:If 1 then display the configuration used in /etc/modprobe.conf.
parm: ql2xplogiabsentdevice:Option to enable PLOGI to devices that are not present after a Fabric scan. This is needed for several broken switches.Default is 0 - no PLOGI. 1 - perfom PLOGI.
parm: ql2xenablezio:Option to enable ZIO:If 1 then enable it otherwise use the default set in the NVRAM. Default is 0 : disabled
parm: ql2xintrdelaytimer:ZIO: Waiting time for Firmware before it generates an interrupt to the host to notify completion of request.
parm: ConfigRequired:If 1, then only configured devices passed in through theql2xopts parameter will be presented to the OS
parm: Bind:Target persistent binding method: 0 by Portname (default); 1 by PortID; 2 by Nodename.
parm: ql2xsuspendcount:Number of 6-second suspend iterations to perform while a target returns a <NOT READY> status. Default is 10 iterations.
parm: ql2xdoinitscan:Signal mid-layer to perform scan after driver load: 0 -- no signal sent to mid-layer.
parm: ql2xloginretrycount:Specify an alternate value for the NVRAM login retry count.
parm: ql2xprocessnotready:Option to disable handling of NOT-READY in the driver. Default is 1 - Handled by the driver. Set to 0 - Disable the handling inside the driver
parm: ql2xprocessrscn:Option to enable port RSCN handling via a series of lessfabric intrusive ADISCs and PLOGIs.
parm: ql2xioctltimeout:IOCTL timeout value in seconds for pass-thur commands. Default is 66 seconds.
parm: extended_error_logging:Option to enable extended error logging, Default is 0 - no logging. 1 - log errors.
parm: ql2xfwloadbin:Option to enable loading of ISP24xx firmware via the request_firmware() (hotplug) interface. If enabled, a file, ql2400_fw.bin, (containing the firmware image) should be hotplug accessible.
parm: ql2xfdmienable:Enables FDMI registratons Default is 0 - no FDMI. 1 - perfom FDMI.
author: QLogic Corporation
description: QLogic Fibre Channel HBA Driver
license: GPL
version: 8.01.60
parm: ql2xfailover:Driver failover support: 0 to disable; 1 to enable.
parm: recoveryTime:Recovery time in seconds before a target device is sent I/O after a failback is performed.
parm: failbackTime:Delay in seconds before a failback is performed.
parm: MaxPathsPerDevice:Maximum number of paths to a device. Default 8.
parm: MaxRetriesPerPath:How many retries to perform on the current path before failing over to the next path in the path list.
parm: MaxRetriesPerIo:How many total retries to do before failing the command and returning to the OS with a DID_NO_CONNECT status.
parm: qlFailoverNotifyType:Failover notification mechanism to use when a failover or failback occurs.
parm: ql2xlbType:Load Balance Method : (0) None (1) static load balance and Default : 0 All the luns exposed on the first active path : 1 For static load balance across active optimised controller ports
parm: ql2xexcludemodel:Exclude device models from being marked as failover capable.Combine one or more of the following model numbers into an exclusion mask: 0x20 - HSV210, 0x10 - DSXXX, 0x04 - HSV110, 0x02 - MSA1000, 0x01 - XP128.
parm: ql2xtgtemul:Enable/Disable target combining emulation.Default : 1 Enable target failover emulation for targets created by lunid matching : 0 Disable target failover emulation
vermagic: 2.6.9-11.19AXsmp SMP 686 REGPARM 4KSTACKS gcc-3.4
depends: scsi_mod
alias: pci:v00001077d00002422sv*sd*bc*sc*i*
alias: pci:v00001077d00002432sv*sd*bc*sc*i*

主要看最后以alias开头的两行,其中的1077对应卡的厂家,后面的2432、2422是卡的型号。
正好,这个qla2xxx正好支持这个光纤卡。

发表于: 2009-04-10,修改于: 2009-04-10 11:52

from http://blogold.chinaunix.net/u1/43502/showart_1896158.html

发表评论?

0 条评论。

发表评论