Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Mar 1998 23:49:34 +0200 (EET)
From:      Vladimir Kushnir <kushn@mail.kar.net>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   DEVFS awareness for VoxWare?
Message-ID:  <Pine.BSF.3.96.980323225104.8534A-100000@kushnir.kiev.ua>

next in thread | raw e-mail | index | archive | help
Hello,
Sorry if this does not belong here or just plain stupid.
Yes, I know fairly well this is not one of the urgent things (especially
now), but since new sound driver does not yet support midi port, would not
it make some sence to update a bit the old one? In particular, I mean
adding DEVFS awareness to it. It doesn't seem to be too difficult (see
patch below). It works (as it should to - after all, there's nothing new
there). Unfortunately, I'm too ignorant as a programmer and can't suggest
nothing better, but perhaps somebody would take a pain to improve it (to
avoid silly code duplication with all unneeded if's) and add other
supported cards (I've got only  Yamaha SA2 card with MSS and SB
simulations and OPL3 FM)?   

Regards,
Vladimir

/*--------------------sys/i386/isa/sound/soundcard.c.diff-----------------*/

*** ../tmp/soundcard.c	Mon Mar 23 22:48:26 1998
--- soundcard.c	Mon Mar 23 16:22:06 1998
***************
*** 26,33 ****
--- 26,37 ----
   * SUCH DAMAGE.
   * 
   */
+ #include "opt_devfs.h"
  
  #include <i386/isa/sound/sound_config.h>
+ #ifdef DEVFS
+ #include <sys/devfsext.h>
+ #endif /* DEVFS */
  
  #if NSND > 0	/* from "snd.h" */
  #include <vm/vm.h>
***************
*** 449,456 ****
  	dev = makedev(CDEV_MAJOR, 0);
  	cdevsw_add(&dev, &snd_cdevsw, NULL);
      }
! 
! 
      return TRUE;
  }
  
--- 453,481 ----
  	dev = makedev(CDEV_MAJOR, 0);
  	cdevsw_add(&dev, &snd_cdevsw, NULL);
      }
! #ifdef DEVFS
! /*    if (dev->id_driver == &sbdriver || dev->id_driver == &gusdriver ||
!        dev->id_driver == &sbxvidriver || dev->id_driver == &mssdriver) */
!     if (dev->id_driver == &mssdriver)   
!     {
!     devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP, DV_CHR,
! 		     UID_ROOT, GID_WHEEL, 0666, "dsp%n", dev->id_unit);
!     devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP16, DV_CHR,
! 		     UID_ROOT, GID_WHEEL, 0666, "dspW%n", dev->id_unit);
!     devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_AUDIO, DV_CHR,
! 		     UID_ROOT, GID_WHEEL, 0666, "audio%n", dev->id_unit);
!     devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_CTL, DV_CHR,
! 		     UID_ROOT, GID_WHEEL, 0666, "mixer%n", dev->id_unit);
!     devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_STATUS, DV_CHR,
! 		     UID_ROOT, GID_WHEEL, 0666, "sndstat%n", dev->id_unit);
!     }
!     else if (dev->id_driver == &opldriver)   
!     devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_SEQ, DV_CHR,
! 		     UID_ROOT, GID_WHEEL, 0666, "sequencer%n", dev->id_unit);
!     else if (dev->id_driver == &mpudriver)        
!     devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_MIDIN, DV_CHR,
! 		     UID_ROOT, GID_WHEEL, 0666, "midi%n", dev->id_unit);
! #endif /* DEVFS */            
      return TRUE;
  }
  




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.980323225104.8534A-100000>