Re: pci_read_config_byte in 2.1.85

Stephen Williams (steve@icarus.icarus.com)
Wed, 04 Feb 1998 20:35:37 -0800


mj@atrey.karlin.mff.cuni.cz said:
> I think of replacing pcibios_find_* functions by pci_find_* working
> with pci_dev structures and make all drivers use the new functions and
> fetch both the base addresses and irq's from pci_dev.

Be careful of hiding the real world from programmers too much. I think
what you propose is fine, especially since it allows the pcibios_*
functions to continue to exist unaltered.

I'm sorry, but I write Windows NT device drivers as well as Linux device
drivers (yes I get paid for both) and I *don't* want to see another HAL.

Now as for the matter of the IRQ value in the PCI configuration space and
its applicability to the kernel world, well, that is what it exists for.
It turns out that the interrupt number in the configuration space is
strictly a means for a BIOS to communitate IRQ assignment to the O/S. I do
not believe that the board is even allowed to look at the number contained
therin.

Since it is entirely a matter between the BIOS and the kernel, it is perfectly
reasonable for a device driver to use that value for selecting interrupts.
If the Linux kernel doesn't like it, perhaps it should change it.

I do a lot of PCI device drivers, Linux and NT (and even embedded, I've
written a "PCI BIOS" for an embedded card that has a PCI bus internally)
and believe me you want to keep the layers as thin as possible.

Oh please!

-- 
Steve Williams                "The woods are lovely, dark and deep.
steve@icarus.com              But I have promises to keep,
steve@picturel.com            and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."