Re: Device driver to access PCI configuration space.

Martin Mares (mj@atrey.karlin.mff.cuni.cz)
Thu, 3 Jul 1997 18:29:48 +0200


Hi,

> Here is a device driver to access PCI configuration space.
>
> The PCI spec says that there are 256 configuration space
> registers. The first 64 are standardised, and the kernel prints
> them in /proc/pci. When you have a chip that has more configuration
> space registers than the first 64, you can use this device to read
> them all. You can also change them from user space by writing to
> the device. Intel PCI chipsets usually have a bunch of registers
> in the "chip specific" region, and even some undocumented registers
> (0xf8, 0xf9).
>
> I am having trouble with a video chip not getting enough bandwidth to
> dump a video frame into memory. The intel documentation about my
> chipset talks about an "MTT" register, and I wanted to know what it
> was set at, and see if changing it would help.
>
> Linus: I would like this to go into the mainstream kernel. Changes
> seem localized enough. I think I followed the Linux coding style close
> enough. If not, tell me.

I propose another solution: extend the proc filesystem and introduce a
/proc/pci tree containing subdirectories bus_number/device_number with
several special files for config space access, device memory access etc.
This would be much cleaner and more flexible.

Have a nice fortnight

-- 
Martin `MJ' Mares   <mj@gts.cz>   http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
"return(ECRAY); /* Program exited before being run */"