summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Knispel <gknispel@proformatique.com>2012-02-15 18:30:37 +0100
committerGuillaume Knispel <gknispel@proformatique.com>2012-02-15 18:30:37 +0100
commit9239c48f767083d0fba314054edabaa5e9dac59a (patch)
tree0d7c230386da4acf82ca9969db0bb2936583dd6a
parentaf8ad1dd6ffae6bd924dd4bb8628a79364f91e23 (diff)
add soft conf traces
-rw-r--r--xhfc/base.c37
-rw-r--r--xhfc/xhfc.h4
-rw-r--r--xhfc/xhfc_leb.h3
3 files changed, 35 insertions, 9 deletions
diff --git a/xhfc/base.c b/xhfc/base.c
index 900d78b..e3d10b9 100644
--- a/xhfc/base.c
+++ b/xhfc/base.c
@@ -784,23 +784,46 @@ static inline u8 byte_replace_bit(u8 byte, int nr, bool value)
static void configure_ntte(struct xhfc_span *xhfc_span, int nt)
{
struct xhfc *xhfc = xhfc_span->xhfc;
- u8 newb;
- newb = byte_replace_bit(xhfc->pi->soft_conf_byte,
+ u8 soft_conf = xhfc->pi->soft_conf_byte;
+
+ if (DBG_REGS)
+ printk(KERN_INFO "NTTE %d %d before %02x\n",
+ xhfc_span->port, nt,
+ soft_conf);
+
+ soft_conf = byte_replace_bit(soft_conf,
lebcs1_bit_nt(xhfc_span->port),
!!nt);
- xhfc->pi->soft_conf_byte = newb;
- write_xhfc_soft_conf(xhfc, newb);
+
+ xhfc->pi->soft_conf_byte = soft_conf;
+ write_xhfc_soft_conf(xhfc, soft_conf);
+
+ if (DBG_REGS)
+ printk(KERN_INFO "NTTE %d %d after %02x\n",
+ xhfc_span->port, nt,
+ soft_conf);
}
static void configure_term(struct xhfc_span *xhfc_span, int lineterm)
{
struct xhfc *xhfc = xhfc_span->xhfc;
- u8 newb;
- newb = byte_replace_bit(xhfc->pi->soft_conf_byte,
+ u8 soft_conf = xhfc->pi->soft_conf_byte;
+
+ if (DBG_REGS)
+ printk(KERN_INFO "TERM %d %d before %02x\n",
+ xhfc_span->port, lineterm,
+ soft_conf);
+
+ soft_conf = byte_replace_bit(xhfc->pi->soft_conf_byte,
lebcs1_bit_term(xhfc_span->port),
!!lineterm);
- xhfc->pi->soft_conf_byte = newb;
+ xhfc->pi->soft_conf_byte = soft_conf;
write_xhfc_soft_conf(xhfc, xhfc->pi->soft_conf_byte);
+
+ if (DBG_REGS)
+ printk(KERN_INFO "TERM %d %d after %02x\n",
+ xhfc_span->port, lineterm,
+ soft_conf);
}
static void __devinit
diff --git a/xhfc/xhfc.h b/xhfc/xhfc.h
index 4128fe1..a598d4c 100644
--- a/xhfc/xhfc.h
+++ b/xhfc/xhfc.h
@@ -62,8 +62,8 @@
/* general debug messages */
#define DEBUG_GENERAL (1 << 0)
-/* emit register read/write, but only if the kernel's DEBUG is defined */
-#define DEBUG_REGS (1 << 2) // not used
+/* emit register read/write */
+#define DEBUG_REGS (1 << 2)
/* emit file operation messages */
#define DEBUG_FOPS (1 << 3)
#define DEBUG_ECHOCAN (1 << 4)
diff --git a/xhfc/xhfc_leb.h b/xhfc/xhfc_leb.h
index 4ca9d26..467a524 100644
--- a/xhfc/xhfc_leb.h
+++ b/xhfc/xhfc_leb.h
@@ -53,6 +53,9 @@ static inline void write_xhfc_soft_conf(struct xhfc *xhfc, u8 soft_conf)
{
u8 __iomem *cs_n1 = xhfc->pi->cs_n1;
+ if (DBG_REGS)
+ printk(KERN_INFO "SOFTCONF: %02x\n", soft_conf);
+
writeb(soft_conf, &cs_n1[0]);
/* ensure the write has been completed: */