Use of generic device ids in special purpose drivers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I just stumbled across this in drivers/scsi/megaraid.c:

static struct pci_device_id megaraid_pci_tbl[] = {
	{PCI_VENDOR_ID_AMI, PCI_DEVICE_ID_AMI_MEGARAID,
		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
	{PCI_VENDOR_ID_AMI, PCI_DEVICE_ID_AMI_MEGARAID2,
		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_AMI_MEGARAID3,
		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
	{0,}
};


Doesn't look wrong at first, but do notice the PCI_VENDOR_ID_INTEL in
the last entry.  This doesn't just match megaraid devices, but anything
using an Intel i960 processor...


$ grep 1960 include/linux/pci_ids.h
#define PCI_DEVICE_ID_AMI_MEGARAID3     0x1960
#define PCI_DEVICE_ID_INTEL_80960_RP    0x1960


Wouldn't it be more appropriate to do additional matching on
subvendor/subdevice here?  And preferably use
PCI_DEVICE_ID_INTEL_80960_RP with the Intel vendor id.



The reason I noticed this is because I don't have any megaraid device,
but I do have aanother device with an i960:

bjorn@canardo:~$ lspci -vvnns 04:00
04:00.0 PCI bridge [0604]: Intel Corporation 80960RP (i960RP) Microprocessor/Bridge [8086:0960] (rev 05)
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
        Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 64, Cache Line Size: 32 bytes
        Bus: primary=04, secondary=05, subordinate=05, sec-latency=64
        I/O behind bridge: 0000d000-0000dfff
        Memory behind bridge: fea00000-feafffff
        Prefetchable memory behind bridge: fd000000-fdffffff
        Secondary status: 66MHz- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- <SERR- <PERR-
        BridgeCtl: Parity- SERR- NoISA- VGA+ MAbort- >Reset- FastB2B-
                PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
        Kernel modules: shpchp

04:00.1 Memory controller [0580]: Intel Corporation 80960RP (i960RP) Microprocessor [8086:1960] (rev 05)
        Subsystem: Compaq Computer Corporation Device [0e11:c000]
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 64, Cache Line Size: 32 bytes
        Interrupt: pin A routed to IRQ 16
        Region 0: Memory at fcfc0000 (32-bit, prefetchable) [size=256K]
        Expansion ROM at fcf80000 [disabled] [size=64K]
        Kernel modules: megaraid


This is a Compaq "Remote Insight Lights Out Edition" card.



Bjørn
-- 
No nukes

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux