Subject: Re: looking for PCI lkm HOWTO
To: Chuck Tuffli <chuck_tuffli@agilent.com>
From: None <cube@cubidou.net>
List: tech-kern
Date: 06/08/2004 10:30:28
On Tue, Jun 08, 2004 at 12:50:44AM -0700, Chuck Tuffli wrote:
> [This is definitely a newbie question ...]
>
> I'm trying to create the skeleton of a LKM for a PCI device and can't
> seem to get the *_match() function to be called. The driver defines
>
> struct cfattach svdrv_ca = {
> sizeof(struct svdrv_softc), svdrv_pci_match, svdrv_pci_attach
> };
>
> for PCI and
>
> static struct cdevsw svdrv_dev = {
> svdrv_open,
> svdrv_close,
> ...
> };
>
> MOD_DEV("svdrv", "svdrv", NULL, -1, &svdrv_dev, -1);
>
> for the char driver interface. Loading the driver with
>
> modload -e svdrv_lkmentry svdrv.o
>
> prints the message associated with the *_handle() function, but
> svdrv_pci_match() doesn't ever print it's message. Is there an
> additional step or definition that the driver needs to be recognized
> by the PCI bus driver? Thanks for any help or pointers.
Yes, you have to probe and attach the device yourself.
I coded a pcilkm module layer a while ago, you can just use it.
http://cubidou.nerim.net/pcilkm.tgz
It should be self-explanatory enough.
Quentin Garnier.