Module: xenomai-abe
Branch: comedi
Commit: 4f265f8dabc1d1a8c1dc96e1a75c10531d339bfa
URL:    
http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=4f265f8dabc1d1a8c1dc96e1a75c10531d339bfa

Author: Alexis Berlemont <alexis.berlem...@gmail.com>
Date:   Fri Sep 11 01:10:01 2009 +0200

Fix debug trace routines

---

 ksrc/drivers/comedi/national_instruments/mite.c |   87 +++++++++++++---------
 ksrc/drivers/comedi/national_instruments/mite.h |    6 --
 2 files changed, 51 insertions(+), 42 deletions(-)

diff --git a/ksrc/drivers/comedi/national_instruments/mite.c 
b/ksrc/drivers/comedi/national_instruments/mite.c
index dcc84c5..8f1ccd7 100644
--- a/ksrc/drivers/comedi/national_instruments/mite.c
+++ b/ksrc/drivers/comedi/national_instruments/mite.c
@@ -46,6 +46,12 @@
 
 #include "mite.h"
 
+#ifdef CONFIG_DEBUG_MITE
+#define MDPRINTK(fmt, args...) rtdm_printk(fmt, ##args)
+#else /* !CONFIG_DEBUG_MITE */
+#define MDPRINTK(fmt, args...)
+#endif /* CONFIG_DEBUG_MITE */
+
 static LIST_HEAD(mite_devices);
 
 static struct pci_device_id mite_id[] = {
@@ -327,7 +333,7 @@ void mite_dma_arm(struct mite_channel *mite_chan)
        int chor;
        unsigned long flags;
 
-       MDPRINTK("mite_dma_arm ch%i\n", channel);
+       MDPRINTK("mite_dma_arm ch%i\n", mite_chan->channel);
        /* Memory barrier is intended to insure any twiddling with the buffer
           is done before writing to the mite to arm dma transfer */
        smp_mb();
@@ -433,7 +439,8 @@ void mite_prep_dma(struct mite_channel *mite_chan,
                   */
                chcr |= CHCR_BYTE_SWAP_DEVICE | CHCR_BYTE_SWAP_MEMORY;
        }
-       if (mite_chan->dir == COMEDI_BUF_PUT) {
+
+       if (mite_chan->dir == COMEDI_INPUT) {
                chcr |= CHCR_DEV_TO_MEM;
        }
        writel(chcr, mite->mite_io_addr + MITE_CHCR(mite_chan->channel));
@@ -603,7 +610,7 @@ int mite_done(struct mite_channel *mite_chan)
 
 #ifdef CONFIG_DEBUG_MITE
 
-static void mite_decode(char **bit_str, unsigned int bits);
+static void mite_decode(const char *const bit_str[], unsigned int bits);
 
 /* names of bits in mite registers */
 
@@ -681,60 +688,68 @@ void mite_dump_regs(struct mite_channel *mite_chan)
        unsigned long addr = 0;
        unsigned long temp = 0;
 
-       __comedi_info("mite_dump_regs ch%i\n", mite_chan->channel);
-       __comedi_info("mite address is  =0x%08lx\n", mite_io_addr);
+       printk("mite_dump_regs ch%i\n", mite_chan->channel);
+       printk("mite address is  =0x%08lx\n", mite_io_addr);
 
-       addr = mite_io_addr + MITE_CHOR(channel);
-       __comedi_info("mite status[CHOR]at 0x%08lx =0x%08lx\n", addr, temp =
-               readl(addr));
+       addr = mite_io_addr + MITE_CHOR(mite_chan->channel);
+       printk("mite status[CHOR]at 0x%08lx =0x%08lx\n", addr, temp =
+               readl((void *)addr));
        mite_decode(mite_CHOR_strings, temp);
-       addr = mite_io_addr + MITE_CHCR(channel);
-       __comedi_info("mite status[CHCR]at 0x%08lx =0x%08lx\n", addr, temp =
-               readl(addr));
+       addr = mite_io_addr + MITE_CHCR(mite_chan->channel);
+       printk("mite status[CHCR]at 0x%08lx =0x%08lx\n", addr, temp =
+               readl((void *)addr));
        mite_decode(mite_CHCR_strings, temp);
-       addr = mite_io_addr + MITE_TCR(channel);
-       __comedi_info("mite status[TCR] at 0x%08lx =0x%08x\n", addr, 
readl(addr));
-       addr = mite_io_addr + MITE_MCR(channel);
-       __comedi_info("mite status[MCR] at 0x%08lx =0x%08lx\n", addr, temp =
-               readl(addr));
+       addr = mite_io_addr + MITE_TCR(mite_chan->channel);
+       printk("mite status[TCR] at 0x%08lx =0x%08x\n", addr, 
+                     readl((void *)addr));
+       addr = mite_io_addr + MITE_MCR(mite_chan->channel);
+       printk("mite status[MCR] at 0x%08lx =0x%08lx\n", addr, temp =
+               readl((void *)addr));
        mite_decode(mite_MCR_strings, temp);
 
-       addr = mite_io_addr + MITE_MAR(channel);
-       __comedi_info("mite status[MAR] at 0x%08lx =0x%08x\n", addr, 
readl(addr));
-       addr = mite_io_addr + MITE_DCR(channel);
-       __comedi_info("mite status[DCR] at 0x%08lx =0x%08lx\n", addr, temp =
-               readl(addr));
+       addr = mite_io_addr + MITE_MAR(mite_chan->channel);
+       printk("mite status[MAR] at 0x%08lx =0x%08x\n", addr, 
+                     readl((void *)addr));
+       addr = mite_io_addr + MITE_DCR(mite_chan->channel);
+       printk("mite status[DCR] at 0x%08lx =0x%08lx\n", addr, temp =
+               readl((void *)addr));
        mite_decode(mite_DCR_strings, temp);
-       addr = mite_io_addr + MITE_DAR(channel);
-       __comedi_info("mite status[DAR] at 0x%08lx =0x%08x\n", addr, 
readl(addr));
-       addr = mite_io_addr + MITE_LKCR(channel);
-       __comedi_info("mite status[LKCR]at 0x%08lx =0x%08lx\n", addr, temp =
-               readl(addr));
+       addr = mite_io_addr + MITE_DAR(mite_chan->channel);
+       printk("mite status[DAR] at 0x%08lx =0x%08x\n", addr, 
+                     readl((void *)addr));
+       addr = mite_io_addr + MITE_LKCR(mite_chan->channel);
+       printk("mite status[LKCR]at 0x%08lx =0x%08lx\n", addr, temp =
+               readl((void *)addr));
        mite_decode(mite_LKCR_strings, temp);
-       addr = mite_io_addr + MITE_LKAR(channel);
-       __comedi_info("mite status[LKAR]at 0x%08lx =0x%08x\n", addr, 
readl(addr));
+       addr = mite_io_addr + MITE_LKAR(mite_chan->channel);
+       printk("mite status[LKAR]at 0x%08lx =0x%08x\n", addr, 
+                     readl((void *)addr));
 
-       addr = mite_io_addr + MITE_CHSR(channel);
-       __comedi_info("mite status[CHSR]at 0x%08lx =0x%08lx\n", addr, temp =
-               readl(addr));
+       addr = mite_io_addr + MITE_CHSR(mite_chan->channel);
+       printk("mite status[CHSR]at 0x%08lx =0x%08lx\n", addr, temp =
+               readl((void *)addr));
        mite_decode(mite_CHSR_strings, temp);
-       addr = mite_io_addr + MITE_FCR(channel);
-       __comedi_info("mite status[FCR] at 0x%08lx =0x%08x\n\n", addr, 
readl(addr));
+       addr = mite_io_addr + MITE_FCR(mite_chan->channel);
+       printk("mite status[FCR] at 0x%08lx =0x%08x\n\n", addr, 
+                     readl((void *)addr));
 }
 
-static void mite_decode(char **bit_str, unsigned int bits)
+
+static void mite_decode(const char *const bit_str[], unsigned int bits)
 {
        int i;
 
        for (i = 31; i >= 0; i--) {
                if (bits & (1 << i)) {
-                       __comedi_info(" %s", bit_str[i]);
+                       printk(" %s", bit_str[i]);
                }
        }
-       __comedi_info("\n");
+       printk("\n");
 }
+
 #endif /* CONFIG_DEBUG_MITE */
 
+
 static int __init mite_init(void)
 {
        int err;
diff --git a/ksrc/drivers/comedi/national_instruments/mite.h 
b/ksrc/drivers/comedi/national_instruments/mite.h
index 3282d08..82e3722 100644
--- a/ksrc/drivers/comedi/national_instruments/mite.h
+++ b/ksrc/drivers/comedi/national_instruments/mite.h
@@ -25,12 +25,6 @@
 
 #include <comedi/comedi_driver.h>
 
-#ifdef CONFIG_DEBUG_MITE
-#define MDPRINTK(fmt, args...) rtdm_printk(format, ##args)
-#else /* !CONFIG_DEBUG_MITE */
-#define MDPRINTK(fmt, args...)
-#endif /* CONFIG_DEBUG_MITE */
-
 #define PCI_VENDOR_ID_NATINST 0x1093
 #define PCI_MITE_SIZE 4096
 #define PCI_DAQ_SIZE 4096


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

Reply via email to