Subject: Re: Loading DSP code from an LKM
To: None <tech-kern@netbsd.org>
From: Thor Lancelot Simon <tls@rek.tjls.com>
List: tech-kern
Date: 09/27/2001 15:45:01
On Thu, Sep 27, 2001 at 03:39:00PM -0300, Jared D. McNeill wrote:
> On Thu, 27 Sep 2001, Lennart Augustsson wrote:
> > "Jared D. McNeill" wrote:
> >
> > > In an attempt to remove all of the GPL'd bits from my ESS Allegro-1 /
> > > Maestro3 driver, I've decided to load the GPL'd DSP code onto the card
> > > from an LKM. Good idea, in theory..
> >
> > My personal preference would have been an ioctl() to loadthe DSP code.
> > The driver would then set up everything as usual, but have a flag which
> > indicates if the DSP code is present.
> 
> Some things can't be configured if the DSP code isn't loaded, but yea --
> open returns Device not configured if sc->dsp_loaded isn't true.
> 
> Of course, that's pretty much irrelevant now that I think about it, since
> I dont' call audio_attach_mi until the LKM is loaded.
> 
> I'm going to play around with a few more ideas and see what I can come up
> with.
> 
> > It might still be a good idea to have the whole driver as an LKM, but I'd
> > prefer no to require the LKM option to get the sound driver running.
> 
> Maybe we should have a generic way of loading DSP code onto sound cards.
> It seems to me that other drivers (emu10k???) would need something like
> this as well.

Please remember that since these cards have DMA engines on them, the
ioctl to load the firmware (like any ioctl loading firmware into a
device, really) must not work at securelevel > 0.

-- 
Thor Lancelot Simon	                                      tls@rek.tjls.com
    And now he couldn't remember when this passion had flown, leaving him so
  foolish and bewildered and astray: can any man?
						   William Styron