Hello,

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

   The correct list is [EMAIL PROTECTED] ;-)
 
> 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?

   This is to get rid of problems with signed devfn.

                                Have a nice fortnight
-- 
Martin `MJ' Mares   <[EMAIL PROTECTED]>   http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
"In accord to UNIX philosophy, PERL gives you enough rope to hang yourself." -- Larry 
Wall

Reply via email to