Re: pci_find_class question

Martin Mares (mj@ucw.cz)
Tue, 3 Aug 1999 23:15:44 +0200


Hi Tim,

> Here's a patch that doesn't work as intended. The idea is to find all
> 'parallel communication' PCI cards, but that doesn't happen. The card I
> have in this machine seems to have class
> ((PCI_CLASS_COMMUNICATION_PARALLEL << 8) | 2), and pci_find_class just
> does a straight compare with no masking.
>
> So I guess what I'm really asking is: what does the LSB byte in the class
> mean?

The LSB contains a programming interface code.

The pci_find_class function is a mistake of history. Either walk the
list of pci_dev structures or use pci_find_device(PCI_ANY_ID, PCI_ANY_ID, ...)
and check the class codes yourself.

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
"Linux _is_ user-friendly.  It is not ignorant-friendly and idiot-friendly."

- 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/