Module: xenomai-abe
Branch: analogy
Commit: 2c5f01046300f95ca119dbf332817243d648d85d
URL:    
http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=2c5f01046300f95ca119dbf332817243d648d85d

Author: Alexis Berlemont <alexis.berlem...@gmail.com>
Date:   Tue Nov  3 23:22:51 2009 +0100

analogy: fix a critical bug in the NI PCIMIO driver

The MITE ring buffer descriptor was badly configured at the first
acquisition. The pages addresses were filled only after having sent
the descriptor to the MITE.

---

 .../analogy/national_instruments/mio_common.c      |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/ksrc/drivers/analogy/national_instruments/mio_common.c 
b/ksrc/drivers/analogy/national_instruments/mio_common.c
index d23ee12..860ba90 100644
--- a/ksrc/drivers/analogy/national_instruments/mio_common.c
+++ b/ksrc/drivers/analogy/national_instruments/mio_common.c
@@ -1359,6 +1359,10 @@ static int ni_ai_setup_MITE_dma(a4l_dev_t *dev)
        if (retval)
                return retval;
 
+       /* Huge hack */
+       mite_buf_change(devpriv->ai_mite_chan->ring, 
+                       dev->transfer.bufs[NI_AI_SUBDEV]);
+
        switch (boardtype.reg_type) {
        case ni_reg_611x:
        case ni_reg_6143:
@@ -1372,10 +1376,6 @@ static int ni_ai_setup_MITE_dma(a4l_dev_t *dev)
                break;
        };
 
-       /* Huge hack */
-       mite_buf_change(devpriv->ai_mite_chan->ring, 
-                       dev->transfer.bufs[NI_AI_SUBDEV]);
-
        /* start the MITE */
        mite_dma_arm(devpriv->ai_mite_chan);
 
@@ -1391,6 +1391,8 @@ static int ni_ao_setup_MITE_dma(a4l_dev_t *dev)
        if (retval)
                return retval;
 
+       /* TODO: mite_buf_change should be called */
+
        a4l_lock_irqsave(&devpriv->mite_channel_lock, flags);
        if (devpriv->ao_mite_chan) {
                if (boardtype.reg_type & (ni_reg_611x | ni_reg_6713)) {


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to