From owner-freebsd-hackers Mon Dec 30 12:48:49 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id MAA17864 for hackers-outgoing; Mon, 30 Dec 1996 12:48:49 -0800 (PST) Received: from who.cdrom.com (who.cdrom.com [204.216.27.3]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id MAA17859 for ; Mon, 30 Dec 1996 12:48:47 -0800 (PST) Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by who.cdrom.com (8.7.5/8.6.11) with ESMTP id MAA24233 for ; Mon, 30 Dec 1996 12:48:41 -0800 (PST) Received: from current1.whistle.com (current1.whistle.com [207.76.205.22]) by alpo.whistle.com (8.8.2/8.8.2) with SMTP id MAA10143; Mon, 30 Dec 1996 12:44:49 -0800 (PST) Message-ID: <32C8297C.446B9B3D@whistle.com> Date: Mon, 30 Dec 1996 12:43:40 -0800 From: Julian Elischer Organization: Whistle Communications X-Mailer: Mozilla 3.0Gold (X11; I; FreeBSD 2.2-CURRENT i386) MIME-Version: 1.0 To: Joerg Wunsch CC: FreeBSD hackers , Randy Terbush Subject: Re: DEVFS strangeness References: <199612301840.TAA09551@uriah.heep.sax.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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. ;-)