Commit 190f71d9 authored by Andreas Eversberg's avatar Andreas Eversberg Committed by Karsten Keil

mISDN: Add some debug option for clock problems

Add a new debug bit for clock problems.
Signed-off-by: default avatarAndreas Eversberg <andreas@eversberg.eu>
Signed-off-by: default avatarKarsten Keil <kkeil@suse.de>
parent 8dd2f36f
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#define DEBUG_DSP_TONE 0x0020 #define DEBUG_DSP_TONE 0x0020
#define DEBUG_DSP_BLOWFISH 0x0040 #define DEBUG_DSP_BLOWFISH 0x0040
#define DEBUG_DSP_DELAY 0x0100 #define DEBUG_DSP_DELAY 0x0100
#define DEBUG_DSP_CLOCK 0x0200
#define DEBUG_DSP_DTMFCOEFF 0x8000 /* heavy output */ #define DEBUG_DSP_DTMFCOEFF 0x8000 /* heavy output */
/* options may be: /* options may be:
......
...@@ -1192,7 +1192,7 @@ dsp_cmx_receive(struct dsp *dsp, struct sk_buff *skb) ...@@ -1192,7 +1192,7 @@ dsp_cmx_receive(struct dsp *dsp, struct sk_buff *skb)
* we set our new read pointer, and write silence to buffer * we set our new read pointer, and write silence to buffer
*/ */
if (((dsp->rx_W-dsp->rx_R) & CMX_BUFF_MASK) >= CMX_BUFF_HALF) { if (((dsp->rx_W-dsp->rx_R) & CMX_BUFF_MASK) >= CMX_BUFF_HALF) {
if (dsp_debug & DEBUG_DSP_CMX) if (dsp_debug & DEBUG_DSP_CLOCK)
printk(KERN_DEBUG printk(KERN_DEBUG
"cmx_receive(dsp=%lx): UNDERRUN (or overrun the " "cmx_receive(dsp=%lx): UNDERRUN (or overrun the "
"maximum delay), adjusting read pointer! " "maximum delay), adjusting read pointer! "
...@@ -1218,7 +1218,7 @@ dsp_cmx_receive(struct dsp *dsp, struct sk_buff *skb) ...@@ -1218,7 +1218,7 @@ dsp_cmx_receive(struct dsp *dsp, struct sk_buff *skb)
if (dsp->cmx_delay) if (dsp->cmx_delay)
if (((dsp->rx_W - dsp->rx_R) & CMX_BUFF_MASK) >= if (((dsp->rx_W - dsp->rx_R) & CMX_BUFF_MASK) >=
(dsp->cmx_delay << 1)) { (dsp->cmx_delay << 1)) {
if (dsp_debug & DEBUG_DSP_CMX) if (dsp_debug & DEBUG_DSP_CLOCK)
printk(KERN_DEBUG printk(KERN_DEBUG
"cmx_receive(dsp=%lx): OVERRUN (because " "cmx_receive(dsp=%lx): OVERRUN (because "
"twice the delay is reached), adjusting " "twice the delay is reached), adjusting "
...@@ -1374,7 +1374,8 @@ dsp_cmx_send_member(struct dsp *dsp, int len, s32 *c, int members) ...@@ -1374,7 +1374,8 @@ dsp_cmx_send_member(struct dsp *dsp, int len, s32 *c, int members)
r = (r+1) & CMX_BUFF_MASK; r = (r+1) & CMX_BUFF_MASK;
} }
if (r != rr) { if (r != rr) {
printk(KERN_DEBUG "%s: buffer empty\n", if (dsp_debug & DEBUG_DSP_CLOCK)
printk(KERN_DEBUG "%s: RX empty\n",
__func__); __func__);
memset(d, dsp_silence, (rr-r)&CMX_BUFF_MASK); memset(d, dsp_silence, (rr-r)&CMX_BUFF_MASK);
} }
...@@ -1724,7 +1725,7 @@ dsp_cmx_send(void *arg) ...@@ -1724,7 +1725,7 @@ dsp_cmx_send(void *arg)
* the delay is greater dsp_poll * the delay is greater dsp_poll
*/ */
if (delay > dsp_poll && !dsp->cmx_delay) { if (delay > dsp_poll && !dsp->cmx_delay) {
if (dsp_debug & DEBUG_DSP_CMX) if (dsp_debug & DEBUG_DSP_CLOCK)
printk(KERN_DEBUG printk(KERN_DEBUG
"%s lowest rx_delay of %d bytes for" "%s lowest rx_delay of %d bytes for"
" dsp %s are now removed.\n", " dsp %s are now removed.\n",
...@@ -1755,7 +1756,7 @@ dsp_cmx_send(void *arg) ...@@ -1755,7 +1756,7 @@ dsp_cmx_send(void *arg)
* have enabled tx_dejitter * have enabled tx_dejitter
*/ */
if (delay > dsp_poll && dsp->tx_dejitter) { if (delay > dsp_poll && dsp->tx_dejitter) {
if (dsp_debug & DEBUG_DSP_CMX) if (dsp_debug & DEBUG_DSP_CLOCK)
printk(KERN_DEBUG printk(KERN_DEBUG
"%s lowest tx_delay of %d bytes for" "%s lowest tx_delay of %d bytes for"
" dsp %s are now removed.\n", " dsp %s are now removed.\n",
...@@ -1821,7 +1822,8 @@ dsp_cmx_transmit(struct dsp *dsp, struct sk_buff *skb) ...@@ -1821,7 +1822,8 @@ dsp_cmx_transmit(struct dsp *dsp, struct sk_buff *skb)
if (space < skb->len) { if (space < skb->len) {
/* write to the space we have left */ /* write to the space we have left */
ww = (ww - 1) & CMX_BUFF_MASK; /* end one byte prior tx_R */ ww = (ww - 1) & CMX_BUFF_MASK; /* end one byte prior tx_R */
printk(KERN_DEBUG "%s: buffer overflow\n", __func__); if (dsp_debug & DEBUG_DSP_CLOCK)
printk(KERN_DEBUG "%s: TX overflow\n", __func__);
} else } else
/* write until all byte are copied */ /* write until all byte are copied */
ww = (w + skb->len) & CMX_BUFF_MASK; ww = (w + skb->len) & CMX_BUFF_MASK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment