added virt_to_bus() translations to set_dma_addr() arguments
authorFrank Mori Hess <fmhess@speakeasy.net>
Tue, 24 Jul 2001 00:28:28 +0000 (00:28 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Tue, 24 Jul 2001 00:28:28 +0000 (00:28 +0000)
comedi/drivers/das16.c
comedi/drivers/das1800.c
comedi/drivers/ni_at_a2150.c

index c9df9c2144744a8ce03aab28e3e0711397dac941..3c5197413ff24aa977375da857f763b8cb58f3d4 100644 (file)
@@ -23,6 +23,8 @@
 
 ************************************************************************
 
+Testing and debugging help provided by Daniel Koch.
+
 Options:
        [0] - base io address
        [1] - irq (optional)
@@ -814,7 +816,7 @@ static int das16_cmd_exec(comedi_device *dev,comedi_subdevice *s)
        /* clear flip-flop to make sure 2-byte registers for
         * count and address get set correctly */
        clear_dma_ff(devpriv->dma_chan);
-       set_dma_addr(devpriv->dma_chan, (unsigned int) devpriv->dma_buffer);
+       set_dma_addr(devpriv->dma_chan, virt_to_bus(devpriv->dma_buffer));
        // set appropriate size of transfer
        devpriv->dma_transfer_size = das16_suggest_transfer_size(*cmd);
        if(devpriv->adc_count * sample_size > devpriv->dma_transfer_size)
@@ -1045,7 +1047,7 @@ static void das16_interrupt(int irq, void *d, struct pt_regs *regs)
                if(devpriv->adc_count > 0) devpriv->adc_count--;
        }
        // re-enable  dma
-       set_dma_addr(devpriv->dma_chan, (unsigned int) devpriv->dma_buffer);
+       set_dma_addr(devpriv->dma_chan, virt_to_bus(devpriv->dma_buffer));
        set_dma_count(devpriv->dma_chan, leftover * sample_size);
        enable_dma(devpriv->dma_chan);
        release_dma_lock(flags);
index 154e3654d86a4b4fd58aafcf009ea8c45a5b8eaf..3fe023022789da400d017b68c19a2ce12099f72a 100644 (file)
@@ -980,7 +980,7 @@ static void das1800_handle_dma(comedi_device *dev, comedi_subdevice *s)
        // re-enable  dma (single dma)
        if((dual_dma == 0) && leftover)
        {
-               set_dma_addr(devpriv->dma_current, (unsigned int) devpriv->dma_current_buf);
+               set_dma_addr(devpriv->dma_current, virt_to_bus(devpriv->dma_current_buf));
                set_dma_count(devpriv->dma_current, leftover * sizeof(short));
                enable_dma(devpriv->dma_current);
                release_dma_lock(flags);
@@ -1006,7 +1006,7 @@ static void das1800_handle_dma(comedi_device *dev, comedi_subdevice *s)
        {
                if(leftover)
                {
-                       set_dma_addr(devpriv->dma_current, (unsigned int) buffer);
+                       set_dma_addr(devpriv->dma_current, virt_to_bus(buffer));
                        set_dma_count(devpriv->dma_current, leftover * sizeof(short));
                        enable_dma(devpriv->dma_current);
                        release_dma_lock(flags);
@@ -1396,7 +1396,7 @@ void setup_dma(comedi_device *dev, comedi_cmd cmd)
        /* clear flip-flop to make sure 2-byte registers for
         * count and address get set correctly */
        clear_dma_ff(devpriv->dma0);
-       set_dma_addr(devpriv->dma0, (unsigned int) devpriv->dma_buf0);
+       set_dma_addr(devpriv->dma0, virt_to_bus(devpriv->dma_buf0));
        // set appropriate size of transfer
        if(devpriv->count * sizeof(short) >= devpriv->dma_buf_size || devpriv->forever)
                set_dma_count(devpriv->dma0, devpriv->dma_buf_size);
@@ -1409,7 +1409,7 @@ void setup_dma(comedi_device *dev, comedi_cmd cmd)
                /* clear flip-flop to make sure 2-byte registers for
                 * count and address get set correctly */
                clear_dma_ff(devpriv->dma1);
-               set_dma_addr(devpriv->dma1, (unsigned int) devpriv->dma_buf1);
+               set_dma_addr(devpriv->dma1, virt_to_bus(devpriv->dma_buf1));
                // set appropriate size of transfer
                if(devpriv->count * sizeof(short) >= 2 * devpriv->dma_buf_size || devpriv->forever)
                        set_dma_count(devpriv->dma1, devpriv->dma_buf_size);
index 2265c8a49f0c006bbeab346db526430e189182c9..4009fd0108eedb44cc22fd2acac2cbadb46c58d3 100644 (file)
@@ -294,7 +294,7 @@ static void a2150_interrupt(int irq, void *d, struct pt_regs *regs)
                }
        }
        // re-enable  dma
-       set_dma_addr(devpriv->dma, (unsigned int) devpriv->dma_buffer);
+       set_dma_addr(devpriv->dma, virt_to_bus(devpriv->dma_buffer));
        set_dma_count(devpriv->dma, leftover * sample_size);
        enable_dma(devpriv->dma);
        release_dma_lock(flags);
@@ -676,7 +676,7 @@ static int a2150_ai_cmd(comedi_device *dev, comedi_subdevice *s)
        /* clear flip-flop to make sure 2-byte registers for
         * count and address get set correctly */
        clear_dma_ff(devpriv->dma);
-       set_dma_addr(devpriv->dma, (unsigned int) devpriv->dma_buffer);
+       set_dma_addr(devpriv->dma, virt_to_bus(devpriv->dma_buffer));
        // set size of transfer to fill in 1/3 second
        devpriv->dma_transfer_size = sizeof(devpriv->dma_buffer[0]) * cmd->chanlist_len *
                (1000000000.0 / 3.0 ) / cmd->scan_begin_arg;