Subject: Re: lkm for pci device
To: matthew green <mrg@eterna.com.au>
From: None <cube@cubidou.net>
List: tech-kern
Date: 07/03/2004 10:00:45
On Sat, Jul 03, 2004 at 05:46:44PM +1000, matthew green wrote:
>
> > The problem is that the autoconfig code isn't set up to rescan the PCI
> > bus, thus there's no easy way to notice your new driver. Also, I'm not
> > sure if there's an easy way to punch your driver into the PCI
> > discovery code.
>
> Well, there is pci_find_device() for that purpose. The drawback is that
> you have to be very careful not to attach to just anything, as you can't
> know if someone has already mapped regions or interrupts before you.
>
>
> it also only attaches the very first one it finds...
I guess the idea behind pci_find_device() was "does such a device exist?".
If you really want to go through all devices, the probe function has to
return 0 and then you have to manage your own counter. That's what I do
for pcilkm, and this smells as a hack, but about everything smells as a
hack with LKMs :)
Quentin Garnier.