Subject: kern/1277: delinting and small bug fixes for audio drivers
To: None <gnats-bugs@gnats.netbsd.org>
From: Mike Long <mikel@shore.net>
List: netbsd-bugs
Date: 07/25/1995 21:53:26
>Number:         1277
>Category:       kern
>Synopsis:       delinting and small bug fixes for audio drivers
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 25 22:05:01 1995
>Last-Modified:
>Originator:     Mike Long
>Organization:
	We don't tolerate such perversity in these here parts
>Release:        7/24/95
>Environment:
System: NetBSD azathoth 1.0A NetBSD 1.0A (AZATHOTH) #24: Tue Jul 25 01:54:42 EDT 1995 root@azathoth:/usr/src/sys/arch/i386/compile/AZATHOTH i386

>Description:
	Prototype police, etc.  The major changes (PSS & WSS) will be
sent in separately.

>How-To-Repeat:
	build a GENERIC kernel.
>Fix:
1) Removed incorrect comment from /sys/dev/ic/cs4231reg.h.
   (double-checked with John Kohl)
2) Prototypes for pasprobe() and pasattach().
3) Prototypes for sbprobe() and sbattach().
4) If you have more than one SB in your system, and they have
   different version numbers, then the version number of the one last
   attached is reported by the AUDIO_GETDEV ioctl.

*** cs4231reg.h.orig	Fri Jul  7 02:57:34 1995
--- cs4231reg.h	Sat Jul  8 13:17:01 1995
***************
*** 70,78 ****
  
  
- /*
-  * The CS4231 mixer is write-only--it cannot be queried for current
-  * settings.  Drivers must keep track of current values themselves.
-  */
- 
  /* CS4231/AD1845 mode2 registers; added to AD1848 registers */
  #define CS_ALT_FEATURE1		0x10
--- 70,73 ----
*** pas.c.orig	Mon Jul 24 08:29:17 1995
--- pas.c	Mon Jul 24 20:52:00 1995
***************
*** 102,107 ****
  int	pasopen __P((dev_t, int));
  
! int	pasprobe();
! void	pasattach();
  
  int	pas_getdev __P((void *, struct audio_device *));
--- 102,107 ----
  int	pasopen __P((dev_t, int));
  
! int	pasprobe __P((struct device *, void *, void *));
! void	pasattach __P((struct device *, struct device *, void *));
  
  int	pas_getdev __P((void *, struct audio_device *));
*** sb.c.orig	Mon Jul 24 08:29:18 1995
--- sb.c	Mon Jul 24 23:40:48 1995
***************
*** 72,76 ****
  };
  
! int	sbprobe();
  void	sbattach __P((struct device *, struct device *, void *));
  
--- 72,76 ----
  };
  
! int	sbprobe __P((struct device *, void *, void *));
  void	sbattach __P((struct device *, struct device *, void *));
  
***************
*** 79,93 ****
  };
  
- struct audio_device sb_device = {
- 	"SoundBlaster",
- 	"x",
- 	"sb"
- };
- 
  int	sbopen __P((dev_t, int));
  
- int	sbprobe();
- void	sbattach();
- 
  int	sb_getdev __P((void *, struct audio_device *));
  
--- 79,84 ----
***************
*** 145,152 ****
  int
  sbprobe(parent, self, aux)
! 	struct device *parent, *self;
! 	void *aux;
  {
! 	register struct sbdsp_softc *sc = (void *)self;
  	register struct isa_attach_args *ia = aux;
  	register u_short iobase = ia->ia_iobase;
--- 136,143 ----
  int
  sbprobe(parent, self, aux)
! 	struct device *parent;
! 	void *self, *aux;
  {
! 	register struct sbdsp_softc *sc = self;
  	register struct isa_attach_args *ia = aux;
  	register u_short iobase = ia->ia_iobase;
***************
*** 280,287 ****
  	sbdsp_attach(sc);
  
- 	sprintf(sb_device.version, "%d.%d", 
- 		SBVER_MAJOR(sc->sc_model),
- 		SBVER_MINOR(sc->sc_model));
- 
  	if ((err = audio_hardware_attach(&sb_hw_if, sc)) != 0)
  		printf("sb: could not attach to audio pseudo-device driver (%d)\n", err);
--- 271,274 ----
***************
*** 315,318 ****
--- 302,316 ----
  	struct audio_device *retp;
  {
+ 	static struct audio_device sb_device = {
+ 		"SoundBlaster",
+ 		"",
+ 		"sb"
+ 	};
+ 	struct sbdsp_softc *sc = addr;
+ 
+ 	sprintf(sb_device.version, "%d.%02d", 
+ 		SBVER_MAJOR(sc->sc_model),
+ 		SBVER_MINOR(sc->sc_model));
+ 
  	*retp = sb_device;
  	return 0;
>Audit-Trail:
>Unformatted: