Module: xenomai-head
Branch: master
Commit: dba6c40fa35a10482a0c00bf54a8b839209579e3
URL:    
http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=dba6c40fa35a10482a0c00bf54a8b839209579e3

Author: Alexis Berlemont <alexis.berlem...@gmail.com>
Date:   Sat Sep  4 17:42:49 2010 +0200

analogy: [pcimio] add the initialization of the ring for gpct subd

---

 .../analogy/national_instruments/mio_common.c      |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/ksrc/drivers/analogy/national_instruments/mio_common.c 
b/ksrc/drivers/analogy/national_instruments/mio_common.c
index 17aa1f5..be10312 100644
--- a/ksrc/drivers/analogy/national_instruments/mio_common.c
+++ b/ksrc/drivers/analogy/national_instruments/mio_common.c
@@ -4486,6 +4486,7 @@ static int ni_gpct_cmd(a4l_subd_t *subd, a4l_cmd_t *cmd)
        int retval;
        a4l_dev_t *dev = subd->dev;
        struct ni_gpct *counter = (struct ni_gpct *)subd->priv;
+       struct mite_dma_descriptor_ring *ring;
 
        retval = ni_request_gpct_mite_channel(dev, 
                                              counter->counter_index,
@@ -4493,9 +4494,20 @@ static int ni_gpct_cmd(a4l_subd_t *subd, a4l_cmd_t *cmd)
        if (retval) {
                a4l_err(dev,
                        "ni_gpct_cmd: "
-                       "no dma channel available for use by counter");
+                       "no dma channel available for use by counter\n");
                return retval;
        }
+
+       ring = devpriv->gpct_mite_ring[counter->counter_index];
+       retval = mite_buf_change(ring, subd);
+       if (retval) {
+               a4l_err(dev,
+                       "ni_gpct_cmd: "
+                       "dma ring configuration failed\n");
+               return retval;
+
+       }
+
        ni_tio_acknowledge_and_confirm(counter, NULL, NULL, NULL, NULL);
        ni_e_series_enable_second_irq(dev, counter->counter_index, 1);
        retval = ni_tio_cmd(counter, cmd);


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

Reply via email to