COMEDI - Linux Control and Measurement Device Interface
Copyright (C) 1997-2001 David A. Schleef <ds@schleef.org>
+ Copyright (C) 2002, 2003 Frank Mori Hess <fmhess@users.sourceforge.net
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
#ifdef PCIDMA
-static void mite_handle_a_linkc(struct mite_struct *mite, comedi_device *dev)
+static void ni_sync_ai_dma(struct mite_struct *mite, comedi_device *dev)
{
int count;
comedi_subdevice *s = dev->subdevices + 0;
#ifdef PCIDMA
/* Currently, mite.c requires us to handle LINKC and DONE */
if(m_status & CHSR_LINKC){
- mite_handle_a_linkc(devpriv->mite, dev);
+ ni_sync_ai_dma(devpriv->mite, dev);
}
if(m_status & CHSR_DONE){
}
#endif // !PCIDMA
- if(devpriv->aimode==AIMODE_SCAN && status&AI_STOP_St){
+ if(devpriv->aimode==AIMODE_SCAN && (status & AI_STOP_St)){
#ifdef PCIDMA
- mite_handle_a_linkc(devpriv->mite, dev);
+ int bytes_in_transit;
+
+ do{
+ bytes_in_transit = mite_bytes_in_transit( devpriv->mite, AI_DMA_CHAN );
+ ni_sync_ai_dma(devpriv->mite, dev);
+ }while( ( s->async->events & COMEDI_CB_EOS ) == 0 &&
+ bytes_in_transit );
#else
ni_handle_fifo_dregs(dev);
s->async->events |= COMEDI_CB_EOS;
return -1;
}
- mite_handle_a_linkc( mite, dev );
+ ni_sync_ai_dma( mite, dev );
return 0;
}