Subject: Re: Need help writing an LKM module
To: Chris Wareham <chris.wareham@iosystems.co.uk>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 06/27/2003 09:23:58
On Fri, 27 Jun 2003, Chris Wareham wrote:

> Bill Studenmund wrote:
> > No. The problem you're going to run into is the same as making an LKM for
> > a real device; that routine is called by the configuration code. One of
> > the drivers is the parent, and one is the "driver" struct for this device.
> >
> > The real problem you'll run into is the parent. It should be the audio
> > device you're attaching to. The problem is that the audio device probes
> > for the midi driver when it attaches, which is at boot. By the time you
> > can load an LKM, it's too late.
> >
> > I'm not sure how to support what you want to do. I think it'd be good, but
> > I'm not sure how to do it. :-)
> >
>
> Thanks for the explanation. I'll just have to put up with booting a new
> kernel whenever I want to test some changes.

For now, that'll probably be the best.

Another option would be, when we get things to where you can load PCI
drivers, to load both the MIDI and the audio card drivers as lkms. All you
would have to do then is load your MIDI code, then load the audio driver.
Getting PCI scans to retrigger is something we've been talking about, and
then when the audio card goes looking for MIDI, it'd find your driver.

But we aren't there yet. :-(

Take care,

Bill