Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Jul 1997 12:04:22 +0200 (MET DST)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        msmith@atrad.adelaide.edu.au (Michael Smith)
Cc:        msmith@atrad.adelaide.edu.au, multimedia@FreeBSD.ORG, hackers@FreeBSD.ORG
Subject:   Re: sound driver structure and configuration
Message-ID:  <199707211004.MAA20937@labinfo.iet.unipi.it>
In-Reply-To: <199707210751.RAA22242@genesis.atrad.adelaide.edu.au> from "Michael Smith" at Jul 21, 97 05:21:11 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> Luigi Rizzo stands accused of saying:
> > > Aha.  May I offer a suggestion?
> > > 
> > > Have the 'snd' controller pull in all the modules for the various 
> > > on-card subsystems.  Have each of these subsystems register themselves
> > > in a linker set using a 'name' field to identify themselves.
> > > 
> > > Then have 'device at ...?' statements which pull in probe code for
> > 
> > right, but this brings me back to the initial question. What does the
> > config progrm do when it finds a "device at foo?" statement ? I have
> > tried running config with different config files where foo is replaced
> > by bar o rother strings and see no difference in the output . I guess
> > the "isa" keyword is somehow magic (or it becomes specially treated
> > because of something in the "files.i386" file ?
> 
> Oops, my previous wasn't good enough, sorry.
> 
> The 'device at foo?' doesn't appear to do anything special, and my
> suggesting it was really wrong.
> 
> Here, in full glory :
> 
> controller	snd?	# sound support, also all chipset modules
> 
> device zw0 at isa? port...	# ZongleWonker ISA board probe
> ...
> device bf0			# Bafwangg PCI soundcard probe
> 
> 
> Then a chipset module might say :
> 
> struct snddriver_module foo_codec = {
> 	foocodec_attach,
> 	SNDD_TYPE_CODEC,
> 	(void *)foocodec_function_switch,
> 	"foo_codec"
> }
> DATA_SET(snddriver, foo_codec);
...
> Does that make more sense? 8)

well, this is exactly what I have done! One minor difference, I have
used a "struct pnp_device" as follows:

    static struct pnp_device cs4236 = {
        "cs4236",
        cs4236_probe,
        cs4236_attach,
        &cs4236_count,
        NULL, /* shutdown */
        &tty_imask      /* imask */
    };  

so that I can easily use a different imask when needed.
Maybe I will need more fields in the struct pnp_device to make the
mechanism more flexible for other device types.

In fact the structure should be the same for ISA/PnP and PCI device,
but I understand that support for autoconfiguring devices
has been added according to the needs of specific buses and the
mechanism is not as clean as it might be. When I am done with the PnP
stuff I will talk back to those who implemented the pci things to
discuss this item.

	Cheers
	Luigi
-----------------------------+--------------------------------------
Luigi Rizzo                  |  Dip. di Ingegneria dell'Informazione
email: luigi@iet.unipi.it    |  Universita' di Pisa
tel: +39-50-568533           |  via Diotisalvi 2, 56126 PISA (Italy)
fax: +39-50-568522           |  http://www.iet.unipi.it/~luigi/
_____________________________|______________________________________



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707211004.MAA20937>