Subject: Re: Need help writing an LKM module
To: Bill Studenmund <firstname.lastname@example.org>
From: Chris Wareham <email@example.com>
Date: 06/27/2003 09:36:48
Bill Studenmund wrote:
> 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. :-)
Thanks for the explanation. I'll just have to put up with booting a new
kernel whenever I want to test some changes.