Subject: kern/4622: isadma.c can't be used if receive size unknown
To: None <>
From: None <>
List: netbsd-bugs
Date: 10/11/1997 07:57:47
>Number:         4622
>Category:       kern
>Synopsis:       isadma.c can't be used with serial dma if recv len not known
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Dec  1 20:50:01 1997
>Originator:     David M. Stanhope Dms
>Release:        NetBSD 1.2G (NETBSD) #1: Sun Oct  5 07:56:36
System: NetBSD 1.2G NetBSD 1.2G (NETBSD) #1: Sun Oct 5 07:56:36 PDT 1997 i386

   We have a custom driver for a 'high-speed' sync serial-port board which
   uses 2 isa dma channels for transmit and receive.  These boards use
   HDLC framing. On the receive side you don't know how big the frame is
   until you get an interrupt saying that a frame has been received, so when
   you initialize the dma controller you don't know what transfer length
   to set, so you must set a length bigger that the largest frame you want
   to allow. This all works fine until you call 'isa_dmadone' which works
   ok but it spits out a message like the follwoing for each packet received.
         isa_dmadone: channel 2 not finished
   while true, this message is meaningless in this context and just fills
   up the logfile, makes the console difficult to use, and is very anoying.
   We currenlty 'fix' this by a simple change to 'isa_dmadone' in
   src/sys/dev/isa/isadma.c to allow us to pass a flag to disable this
   message when needed. It would seem to me that this is a more generally
   desirable feature and would allow us to use a more generic system.
   look at the source or try to write a hdlc driver for 8530 chips using
   isa dma channels.
   Haven't actually done this in current, but we have been using something
   similar in older 1.1 and 1.2 versions of NetBSD. In older version could
   pass a flag to isa_dmadone to say skip the not-finished message but
   flag has gone away so could either add a flag to isa_dmadone with fixing
   it everywhere it is used or more transparently:

   add a flag to src/sys/dev/isa/isadmavar.h such as:
   #define DMAMODE_NO_TC 4 /* don't want terminal count checked */
   this could be ored with DMAMODE_READ when calling isa_dmastart.
   int src/sys/dev/isa/isadma.c:
   expand dmamode array to hold appropriate entries, total of 8 entries.
   have isa_dmastart squirrel away the flags parameter in the isadev
   structure somehow, and if the NO_TC flag is set when isa_dmadone is
   called, don't print the not-finished message.