On Tue, 21 Oct 2003, Eric Anholt wrote:
>
> What is the proper way to get the equivalent of pci_name(pdev) on
> pre-2.5? Also, what is the cutoff where pci_name is available? Are the
> values from pci_name decimal or hex?
The cut-off is 2.5.74 or so.
The numbers are hex, and it's really implemented by just caching the
result of
sprintf(string, "%04x:%02x:%02x.%d",
pci_domain_nr(dev->bus),
dev->bus->number,
PCI_SLOT(dev->devfn),
PCI_FUNC(dev->devfn));
(that last "%d" is irrelevant - the number is alway sin the range 0..7,
so it's same in decimal, octal and hex ;).
"pci_name()" is more convenient in printouts etc. If backwards
compatibility of compatibility with *BSD makes "pci_name()" inconvenient,
feel free to do it by hand like this, but the important parts I had were:
- _please_ use the domain number. There are real machines with multiple
independent PCI buses. We've already seen some real-life problems with
drivers that look for companion chips without knowing about the
"domain" thing, and as a result they find the wrong chip.
The domain problem is rare today, but it will likely be less rare
tomorrow.
- please start thinking of the day when DRI won't be all about PCI, and
the naming might be more complicated than the normal
domain/bus/slot/func thing. Thus the suggestion to tag the address with
the "address type" information.
So whether you use "pci_name()" or anything else is much less important
than the two points above.
Linus
-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel