From owner-freebsd-current Fri Aug 15 03:19:40 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id DAA19630 for current-outgoing; Fri, 15 Aug 1997 03:19:40 -0700 (PDT) Received: from bunyip.cc.uq.edu.au (daemon@bunyip.cc.uq.edu.au [130.102.2.1]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id DAA19621 for ; Fri, 15 Aug 1997 03:19:34 -0700 (PDT) Received: (from daemon@localhost) by bunyip.cc.uq.edu.au (8.8.5/8.8.6) id UAA04171 for freebsd-current@freebsd.org; Fri, 15 Aug 1997 20:19:30 +1000 Received: from localhost.dtir.qld.gov.au by ogre.dtir.qld.gov.au (8.7.5/DEVETIR-E0.3a) with SMTP id UAA02923; Fri, 15 Aug 1997 20:20:34 +1000 (EST) Message-Id: <199708151020.UAA02923@ogre.dtir.qld.gov.au> To: freebsd-current@freebsd.org cc: syssgm@dtir.qld.gov.au Subject: Re: isa.c:isa_dmastatus(int chan) References: <199708150510.WAA00321@rah.star-gate.com> In-Reply-To: <199708150510.WAA00321@rah.star-gate.com> from Amancio Hasty at "Fri, 15 Aug 1997 05:10:29 +0000" Date: Fri, 15 Aug 1997 20:20:34 +1000 From: Stephen McKay Sender: owner-freebsd-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Friday, 15th August 1997, Amancio Hasty wrote: >Can someone delete the enclosed data from isa_dmastatus? > > >isa_dmastatus(int chan) >{ > u_long cnt = 0; > int ffport, waport; > u_long low1, high1, low2, high2; > u_long ef; >/* delete this block of code */ > /* channel active? */ > if ((dma_inuse & (1 << chan)) == 0) { > printf("isa_dmastatus: channel %d not active\n", chan); > return(-1); > } > > /* still busy? */ > if ((dma_busy & (1 << chan)) == 0) { > return(0); > } > >/* end of delete block */ Calling isa_dma_acquire() first will satisfy the first condition, and I think it makes sense to do so. The second condition is trickier, and whether or not it should be deleted depends on what you mean by "busy". Once the channel is in cascade mode, you can think of it as busy. So, in that case, you would add "dma_busy |= 1 << chan" to isa_dmacascade(). You might have other opinions of cascade mode, then the fix is different. >isa_dmastatus is really meant for the sound driver and we are using >in auto dma mode. But it should work for everything. Although this routine has been debated already, it still needs some improvement. Stephen.