Hello guys,
I was so used to the fact that "for any useful A there exists a mailing
list hosted by vger.rutgers.edu called linux-A" - so I posted a message to
[EMAIL PROTECTED] only to have it bounce back...
Anyway, in <linux/pci.h> there are (at least) three useful macros:
/*
* The PCI interface treats multi-function devices as independent
* devices. The slot/function address of each device is encoded
* in a single byte as follows:
*
* 7:3 = slot
* 2:0 = function
*/
#define PCI_DEVFN(slot,func) ((((slot) & 0x1f) << 3) | ((func) & 0x07))
#define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f)
#define PCI_FUNC(devfn) ((devfn) & 0x07)
Why do you need to AND the slot (which, btw, would be more consistent
to call `device number'?) with 0x1f if it is assumed to lie between 0 and 31
anyway?
regards,
Tigran.