Re: finding PCI Card/Subsystem

Martin Mares (mj@ucw.cz)
Fri, 4 Jun 1999 14:27:19 +0200


Hello,

> with lspci i find this card ...
>
> 00:08.0 Communication controller: PLX Technology, Inc.: Unknown device 906d (rev 02)
> Subsystem: Unknown device 125c:0640
>
> It is a PLX 9060SD Based Multiport PCI Card. Currently i search for
> PLX Tech with device id = 906d - But this matches only the generic
> PCI Chip. How do i check against the Subsytem ID to be shure
> i have the correct card ?
>
> if (!(pcibios_find_device(PCI_VENDOR_ID_PLXTECH,
> PCI_DEVICE_ID_9060SD,
> pci_index, &pci_bus,
> &pci_device_fn))) {
>
> pdev = pci_find_slot(pci_bus, pci_device_fn);
>
> /*
> * And what to do now to match on the SubsysID ?
> */
> }

Searching by subsystem vendor/device ID is not supported by the
generic code yet. I plan adding it soon, but in the meantime
you can use the following fragment:

struct pci_dev *dev = NULL;
while (dev = pci_find_device(PCI_VENDOR_ID_PLXTECH, PCI_DEVICE_ID_9060SD, dev) {
u32 sid;
pci_read_config_dword(dev, PCI_SUBSYSTEM_VENDOR_ID, &sid);
if (sid == 0x0640125c) {
/* Device found */
}
}

Have a nice fortnight

-- 
Martin `MJ' Mares   <mj@ucw.cz>   http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
"To understand a program you must become both the machine and the program."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/