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/26/2003 11:39:16
On Thu, 26 Jun 2003, Chris Wareham wrote:

> I'm trying to write an LKM module for the MIDI driver so I modify and
> test it easily. I started with the vnd LKM, but I can't work out where
> the arguments that I need to pass to midiattach() and mididetach() come
> from. The vnd wrapper "invents" an argument, but I guess it's not that
> simple for the MIDI driver.

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. :-)

Take care,

Bill