Date: Mon, 30 Dec 1996 12:43:40 -0800 From: Julian Elischer <julian@whistle.com> To: Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de> Cc: FreeBSD hackers <freebsd-hackers@freebsd.org>, Randy Terbush <randy@zyzzyva.com> Subject: Re: DEVFS strangeness Message-ID: <32C8297C.446B9B3D@whistle.com> References: <199612301840.TAA09551@uriah.heep.sax.de>
next in thread | previous in thread | raw e-mail | index | archive | help
J Wunsch wrote: > > As Randy Terbush wrote: > > > Is this a known deficiency of the DEVFS? > > No, it's a known (now that you mention it :) deficiency of the sound > driver. A quick glance over the source yields: Randy: When I added devfs support to all teh devices, I had to add it to some devices that I didn't understand very well. the sound drivers came under this catagory. I guess I didn't understand it as well as I thought I did. you just need to fix the sections of code marked with #ifdef DEVFS there are man pages in chapter 9 for the devfs entrypoints.. if you have hte time to experiment, you migh tbe the perfect person to submit the patches. > > static int > sndattach (struct isa_device *dev) > { > int unit; > ... > > unit = driver_to_voxunit(dev->id_driver); > ... > > #ifdef DEVFS > /* XXX */ /* find out where to store the tokens.. */ > /* XXX */ /* should only create devices if that card has them */ > #define SND_UID 0 > #define SND_GID 13 > > snd_devfs_token[unit]= > devfs_add_devswf(&snd_cdevsw, (unit << 4)+SND_DEV_CTL, DV_CHR, > ^^^^ > SND_UID, SND_GID, 0660, "mixer%d", unit); > ^^ ^^^^ > > However: > > static int > driver_to_voxunit(struct isa_driver *driver) > { > /* converts a sound driver pointer into the equivalent > VoxWare device unit number */ > if(driver == &opldriver) > return(SNDCARD_ADLIB); > else if(driver == &sbdriver) > return(SNDCARD_SB); > else if(driver == &pasdriver) > return(SNDCARD_PAS); > etc. pp.... > > So this driver seems to have to very different ideas of what a `unit' > might be. If it would really use the term `unit' consistently in the > above sense, it should recognize it always as being unit 4. Probably, > the unit # in the DEVFS sense can only be 0 at all for this driver, > however. > > I think this idea of a unit # is a gross abuse... If i read this > correctly, it would never be possible to put two identical soundcards > into the same machine (on different hardware addresses and interrupt > vectors, i mean)? I think you are right.. Maybe we should take the latest drivers from amancio and the original author and import them, and FIX them :) > > -- > cheers, J"org > > joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE > Never trust an operating system you don't have sources for. ;-)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?32C8297C.446B9B3D>