Subject: kern/6108: wss audio not working (fix included)
To: None <gnats-bugs@gnats.netbsd.org>
From: Ezra Story <ezy@panix.com>
List: netbsd-bugs
Date: 09/05/1998 22:17:53
>Number:         6108
>Category:       kern
>Synopsis:       wss audio not working (fix included)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep  5 19:20:01 1998
>Last-Modified:
>Originator:     Ezra Story
>Organization:
none
>Release:        Sat Sep  5 22:09:26 EDT 1998
>Environment:
NetBSD/i386-current	
System: NetBSD purple 1.3H NetBSD 1.3H (PURPLE) #40: Sat Sep 5 21:39:55 EDT 1998 ezy@purple:/usr/src/netbsd/sys/arch/i386/compile/PURPLE i386


>Description:
audio_if struct in wss was initialized to point to a1848_{open|close}
not ad1848_isa_{open|close} like it should have been.
>How-To-Repeat:

>Fix:
patch follows (includes some updates the the debugging messages to include
"_isa_".)
--

Index: wss.c
===================================================================
RCS file: /usr/src/cvs/netbsd/sys/dev/isa/wss.c,v
retrieving revision 1.1.1.4
diff -c -r1.1.1.4 wss.c
*** wss.c	1998/08/29 15:09:04	1.1.1.4
--- wss.c	1998/09/06 01:38:52
***************
*** 82,89 ****
   */
  
  struct audio_hw_if wss_hw_if = {
! 	ad1848_open,
! 	ad1848_close,
  	NULL,
  	ad1848_query_encoding,
  	ad1848_set_params,
--- 82,89 ----
   */
  
  struct audio_hw_if wss_hw_if = {
! 	ad1848_isa_open,
! 	ad1848_isa_close,
  	NULL,
  	ad1848_query_encoding,
  	ad1848_set_params,
Index: ad1848_isa.c
===================================================================
RCS file: /usr/src/cvs/netbsd/sys/dev/isa/ad1848_isa.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 ad1848_isa.c
*** ad1848_isa.c	1998/08/30 21:16:56	1.1.1.2
--- ad1848_isa.c	1998/09/06 02:04:55
***************
*** 401,407 ****
  {
  	struct ad1848_isa_softc *sc = addr;
  
! 	DPRINTF(("ad1848_open: sc=%p\n", sc));
  
  	sc->sc_lastcc = -1;
  	sc->sc_intr = 0;
--- 401,407 ----
  {
  	struct ad1848_isa_softc *sc = addr;
  
! 	DPRINTF(("ad1848_isa_open: sc=%p\n", sc));
  
  	sc->sc_lastcc = -1;
  	sc->sc_intr = 0;
***************
*** 446,452 ****
  	isc->sc_dma_cnt = cc;
  	isa_dmastart(isc->sc_ic, isc->sc_recdrq, buf, cc, NULL,
  		     isc->sc_dma_flags, BUS_DMA_NOWAIT);
! 	DPRINTF(("ad1848_dma_init_input: %p %d\n", buf, cc));
  	return 0;
  }
  
--- 446,452 ----
  	isc->sc_dma_cnt = cc;
  	isa_dmastart(isc->sc_ic, isc->sc_recdrq, buf, cc, NULL,
  		     isc->sc_dma_flags, BUS_DMA_NOWAIT);
! 	DPRINTF(("ad1848_isa_dma_init_input: %p %d\n", buf, cc));
  	return 0;
  }
  
***************
*** 472,478 ****
  
  #ifdef AUDIO_DEBUG
  	if (ad1848debug > 1)
! 		printf("ad1848_dma_input: cc=%d %p (%p)\n", cc, intr, arg);
  #endif
  	sc->sc_locked = 1;
  	isc->sc_intr = intr;
--- 472,478 ----
  
  #ifdef AUDIO_DEBUG
  	if (ad1848debug > 1)
! 		printf("ad1848_isa_dma_input: cc=%d %p (%p)\n", cc, intr, arg);
  #endif
  	sc->sc_locked = 1;
  	isc->sc_intr = intr;
***************
*** 535,541 ****
  	isc->sc_dma_cnt = cc;
  	isa_dmastart(isc->sc_ic, isc->sc_drq, buf, cc, NULL,
  		     isc->sc_dma_flags, BUS_DMA_NOWAIT);
! 	DPRINTF(("ad1848_dma_init_output: %p %d\n", buf, cc));
  	return 0;
  }
  
--- 535,541 ----
  	isc->sc_dma_cnt = cc;
  	isa_dmastart(isc->sc_ic, isc->sc_drq, buf, cc, NULL,
  		     isc->sc_dma_flags, BUS_DMA_NOWAIT);
! 	DPRINTF(("ad1848_isa_dma_init_output: %p %d\n", buf, cc));
  	return 0;
  }
  
***************
*** 558,564 ****
  
  #ifdef AUDIO_DEBUG
  	if (ad1848debug > 0)
! 		printf("ad1848_dma_output: cc=%d at %p 0x%p (0x%p)\n",
  		       cc, p, intr, arg);
  #endif
  	sc->sc_locked = 1;
--- 558,564 ----
  
  #ifdef AUDIO_DEBUG
  	if (ad1848debug > 0)
! 		printf("ad1848_isa_dma_output: cc=%d at %p 0x%p (0x%p)\n",
  		       cc, p, intr, arg);
  #endif
  	sc->sc_locked = 1;
>Audit-Trail:
>Unformatted:
wss does not have the correct fptrs in the audio_if struct.