Subject: Re: SoC: NDIS
To: Alan Ritter <rittera@cc.wwu.edu>
From: Jachym Holecek <freza@liberouter.org>
List: tech-kern
Date: 06/28/2005 22:07:29
Hello,

> I've already gotten a little bit of a start on this project, though it's not 
> much.  Right now I'm just trying to figure out how to handle matching and 
> attaching the device.  I'm using pci_find_device() to get the match/probe 
> function called, which matches a device with the proper vendor/product ID as 
> identified in the Windows .inf file.  I haven't gotten the attach function 
> called yet.  After reading through this post on tech-kern a bit, however I'm 
> not sure pci_find_device() is the way to go: 

After your LKM hooks itself into autoconf(9), you could hopefully use
pcirescan(), which is exported through struct-cfattach:ca_rescan and
available to userland via drvctl(8) tool (sys/kern/kern_drvctl.c
implements the /dev/drvctl interface). I didn't verify this scenario
though...

There are also some examples of PCI LKMs under sys/lkm/dev/{pci, pcilkm}.

FWIW, I'd probably start with a statically compiled version and LKMize
the framework later on.

	HTH,	
		-- Jachym Holecek