summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-04-28 22:23:52 +0000
committermattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-04-28 22:23:52 +0000
commit2c5d383ce7ad82476fe1687b9d29aad87a80e6ee (patch)
treebcd1b71439ee8b16daa93bb2cbaaf1461fba7a9f
parent62618b4de2d2ac70090ec0991067435380e9e046 (diff)
Enable slip debugging by default, as well as add a parameter to report slips in /proc/zaptel/x
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@2472 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rw-r--r--wct4xxp/base.c39
-rw-r--r--zaptel.c2
-rw-r--r--zaptel.h2
3 files changed, 14 insertions, 29 deletions
diff --git a/wct4xxp/base.c b/wct4xxp/base.c
index 4dd1e73..df7275a 100644
--- a/wct4xxp/base.c
+++ b/wct4xxp/base.c
@@ -165,7 +165,7 @@ static inline int t4_queue_work(struct workqueue_struct *wq, struct work_struct
#endif
-static int debug=0xff;
+static int debug=0x0;
static int timingcable = 0;
static int highestorder;
static int t1e1override = -1; //0xFF; // -1 = jumper; 0xFF = E1
@@ -187,7 +187,6 @@ static int lastdtmfthreshold = VPM_DEFAULT_DTMFTHRESHOLD;
aggressive cards. Please note that burst mode has no effect on CPU
utilization / max number of calls / etc. */
static int noburst = 1;
-static int debugslips = 0;
/* For 56kbps links, set this module parameter to 0x7f */
static int hardhdlcmode = 0xff;
@@ -1856,18 +1855,8 @@ static void __t4_configure_t1(struct t4 *wc, int unit, int lineconfig, int txlev
__t4_framer_out(wc, unit, FRMR_IMR0, 0xff & ~((wc->tspans[unit]->sigchan) ? HDLC_IMR0_MASK : 0)); /* IMR0: We care about CAS changes, etc */
__t4_framer_out(wc, unit, FRMR_IMR1, 0xff & ~((wc->tspans[unit]->sigchan) ? HDLC_IMR1_MASK : 0)); /* IMR1: We care about nothing */
__t4_framer_out(wc, unit, 0x16, 0x00); /* IMR2: We care about all the alarm stuff! */
- if (debugslips) {
- __t4_framer_out(wc, unit, 0x17, 0xf4); /* IMR3: We care about AIS and friends */
- __t4_framer_out(wc, unit, 0x18, 0x3f); /* IMR4: We care about slips on transmit */
- } else {
- __t4_framer_out(wc, unit, 0x17, 0xf7); /* IMR3: We care about AIS and friends */
- __t4_framer_out(wc, unit, 0x18, 0xff); /* IMR4: We don't care about slips on transmit */
- }
-
-#if 0
- t4_check_alarms(wc, unit);
- t4_check_sigbits(wc, unit);
-#endif
+ __t4_framer_out(wc, unit, 0x17, 0xf4); /* IMR3: We care about AIS and friends */
+ __t4_framer_out(wc, unit, 0x18, 0x3f); /* IMR4: We care about slips on transmit */
printk("TE%dXXP: Span %d configured for %s/%s\n", wc->numspans, unit + 1, framing, line);
}
@@ -1945,17 +1934,9 @@ static void __t4_configure_e1(struct t4 *wc, int unit, int lineconfig)
__t4_framer_out(wc, unit, FRMR_IMR0, 0xff & ~((wc->tspans[unit]->sigchan) ? HDLC_IMR0_MASK : 0)); /* IMR0: We care about CRC errors, CAS changes, etc */
__t4_framer_out(wc, unit, FRMR_IMR1, 0x3f & ~((wc->tspans[unit]->sigchan) ? HDLC_IMR1_MASK : 0)); /* IMR1: We care about loopup / loopdown */
__t4_framer_out(wc, unit, 0x16, 0x00); /* IMR2: We care about all the alarm stuff! */
- if (debugslips) {
- __t4_framer_out(wc, unit, 0x17, 0xc4 | imr3extra); /* IMR3: We care about AIS and friends */
- __t4_framer_out(wc, unit, 0x18, 0x3f); /* IMR4: We care about slips on transmit */
- } else {
- __t4_framer_out(wc, unit, 0x17, 0xc7 | imr3extra); /* IMR3: We care about AIS and friends */
- __t4_framer_out(wc, unit, 0x18, 0xff); /* IMR4: We don't care about slips on transmit */
- }
-#if 0
- t4_check_alarms(wc, unit);
- t4_check_sigbits(wc, unit);
-#endif
+ __t4_framer_out(wc, unit, 0x17, 0xc4 | imr3extra); /* IMR3: We care about AIS and friends */
+ __t4_framer_out(wc, unit, 0x18, 0x3f); /* IMR4: We care about slips on transmit */
+
printk("TE%dXXP: Span %d configured for %s/%s%s\n", wc->numspans, unit + 1, framing, line, crc4);
}
@@ -2039,6 +2020,7 @@ static int t4_startup(struct zt_span *span)
t4_check_alarms(wc, span->offset);
t4_check_sigbits(wc, span->offset);
+
if (wc->tspans[0]->sync == span->spanno) printk("SPAN %d: Primary Sync Source\n",span->spanno);
if (wc->tspans[1]->sync == span->spanno) printk("SPAN %d: Secondary Sync Source\n",span->spanno);
if (wc->numspans == 4) {
@@ -2615,7 +2597,8 @@ static inline void t4_framer_interrupt(struct t4 *wc, int span)
if (isr2 || (isr3 & 0x08))
t4_check_alarms(wc, span);
}
- if (debugslips && !ts->span.alarms) {
+ if (!ts->span.alarms) {
+ ts->span.timingslips++;
if (isr3 & 0x02)
printk("TE%d10P: RECEIVE slip NEGATIVE on span %d\n", wc->numspans, span + 1);
if (isr3 & 0x01)
@@ -3357,7 +3340,7 @@ static int t4_hardware_init_1(struct t4 *wc, int gen2)
unsigned int version;
version = t4_pci_in(wc, WC_VERSION);
- printk("TE%dXXP version %08x, burst %s, slip debug: %s\n", wc->numspans, version, noburst ? "OFF" : "ON", debugslips ? "ON" : "OFF");
+ printk("TE%dXXP version %08x, burst %s\n", wc->numspans, version, noburst ? "OFF" : "ON");
#ifdef ENABLE_WORKQUEUES
printk("TE%dXXP running with work queues.\n", wc->numspans);
#endif
@@ -3797,7 +3780,6 @@ MODULE_LICENSE("GPL");
module_param(debug, int, 0600);
module_param(loopback, int, 0600);
module_param(noburst, int, 0600);
-module_param(debugslips, int, 0600);
module_param(timingcable, int, 0600);
module_param(t1e1override, int, 0600);
module_param(alarmdebounce, int, 0600);
@@ -3813,7 +3795,6 @@ module_param(dtmfthreshold, int, 0600);
MODULE_PARM(debug, "i");
MODULE_PARM(loopback, "i");
MODULE_PARM(noburst, "i");
-MODULE_PARM(debugslips, "i");
MODULE_PARM(hardhdlcmode, "i");
MODULE_PARM(timingcable, "i");
MODULE_PARM(t1e1override, "i");
diff --git a/zaptel.c b/zaptel.c
index a83b1fe..18a5aac 100644
--- a/zaptel.c
+++ b/zaptel.c
@@ -602,6 +602,8 @@ static int zaptel_proc_read(char *page, char **start, off_t off, int count, int
len += sprintf(page + len, "\tFAS error count: %d\n", spans[span]->fascount);
if (spans[span]->irqmisses)
len += sprintf(page + len, "\tIRQ misses: %d\n", spans[span]->irqmisses);
+ if (spans[span]->timingslips)
+ len += sprintf(page + len, "\tTiming slips: %d\n", spans[span]->timingslips);
len += sprintf(page + len, "\n");
diff --git a/zaptel.h b/zaptel.h
index 1d64092..60a0635 100644
--- a/zaptel.h
+++ b/zaptel.h
@@ -1364,6 +1364,8 @@ struct zt_span {
int irqmisses; /* Interrupt misses */
+ int timingslips; /* Clock slips */
+
struct zt_chan *chans; /* Member channel structures */
/* ==== Span Callback Operations ==== */