[dahdi-commits] sruffell: linux/trunk r10164 - /linux/trunk/drivers/dahdi/wctdm24xxp/
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Tue Aug 30 11:38:18 CDT 2011
Author: sruffell
Date: Tue Aug 30 11:38:14 2011
New Revision: 10164
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10164
Log:
wctdm24xxp: Change intcount to framecount.
The variable does not necessarily have anything to do with the frequency
of interrupts but is instead a count of sframes received. For example,
it is possible to slow the interrupt rate down on the voicebus cards to
one every 2 frames.
Signed-off-by: Shaun Ruffell <sruffell at digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks at digium.com>
Modified:
linux/trunk/drivers/dahdi/wctdm24xxp/base.c
linux/trunk/drivers/dahdi/wctdm24xxp/wctdm24xxp.h
Modified: linux/trunk/drivers/dahdi/wctdm24xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=10164&r1=10163&r2=10164
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wctdm24xxp/base.c Tue Aug 30 11:38:14 2011
@@ -698,7 +698,7 @@
struct vpmadt032_cmd *curcmd = NULL;
struct vpmadt032 *vpmadt032 = wc->vpmadt032;
int x;
- unsigned char leds = ~((wc->intcount / 1000) % 8) & 0x7;
+ unsigned char leds = ~((wc->framecount / 1000) % 8) & 0x7;
/* Skip audio */
eframe += 24;
@@ -1669,16 +1669,16 @@
if (debug & DEBUG_CARD) {
dev_info(&wc->vb.pdev->dev,
"SLIC_LF OK: card=%d shadow=%02x "
- "lasttxhook=%02x intcount=%d\n", mod->card,
- res, fxs->lasttxhook, wc->intcount);
+ "lasttxhook=%02x framecount=%ld\n", mod->card,
+ res, fxs->lasttxhook, wc->framecount);
}
} else if (fxs->oppending_ms && (--fxs->oppending_ms == 0)) {
wctdm_setreg_intr(wc, mod, LINE_STATE, fxs->lasttxhook);
if (debug & DEBUG_CARD) {
dev_info(&wc->vb.pdev->dev,
"SLIC_LF RETRY: card=%d shadow=%02x "
- "lasttxhook=%02x intcount=%d\n", mod->card,
- res, fxs->lasttxhook, wc->intcount);
+ "lasttxhook=%02x framecount=%ld\n", mod->card,
+ res, fxs->lasttxhook, wc->framecount);
}
} else { /* Start 100ms Timeout */
fxs->oppending_ms = 100;
@@ -1711,28 +1711,6 @@
#else
spin_lock(&wc->reglock);
res = mod->isrshadow[1];
-
-#if 0
- /* This makes sure the lasthook was put in reg 64 the linefeed reg */
- if (fxs->lasttxhook & SLIC_LF_OPPENDING) {
- if ((res & SLIC_LF_SETMASK) == (fxs->lasttxhook & SLIC_LF_SETMASK)) {
- fxs->lasttxhook &= SLIC_LF_SETMASK;
- if (debug & DEBUG_CARD) {
- dev_info(&wc->vb.pdev->dev, "SLIC_LF OK: intcount=%d channel=%d shadow=%02x lasttxhook=%02x\n", wc->intcount, card, res, fxs->lasttxhook);
- }
- } else if (!(wc->intcount & 0x03)) {
- mod->sethook = CMD_WR(LINE_STATE, fxs->lasttxhook);
- if (debug & DEBUG_CARD) {
- dev_info(&wc->vb.pdev->dev, "SLIC_LF RETRY: intcount=%d channel=%d shadow=%02x lasttxhook=%02x\n", wc->intcount, card, res, fxs->lasttxhook);
- }
- }
- }
- if (debug & DEBUG_CARD) {
- if (!(wc->intcount % 100)) {
- dev_info(&wc->vb.pdev->dev, "SLIC_LF DEBUG: intcount=%d channel=%d shadow=%02x lasttxhook=%02x\n", wc->intcount, card, res, fxs->lasttxhook);
- }
- }
-#endif
res = !res && /* reg 64 has to be zero at last isr read */
!(fxs->lasttxhook & SLIC_LF_OPPENDING) && /* not a transition */
@@ -1934,10 +1912,12 @@
b = mod->isrshadow[1]; /* Voltage */
abs_voltage = abs(b);
- if (fxovoltage) {
- if (!(wc->intcount % 100)) {
- dev_info(&wc->vb.pdev->dev, "Port %d: Voltage: %d Debounce %d\n", mod->card + 1, b, fxo->battdebounce);
- }
+ if (fxovoltage && time_after(wc->framecount, fxo->display_fxovoltage)) {
+ /* Every 100 ms */
+ fxo->display_fxovoltage = wc->framecount + 100;
+ dev_info(&wc->vb.pdev->dev,
+ "Port %d: Voltage: %d Debounce %d\n",
+ mod->card + 1, b, fxo->battdebounce);
}
if (unlikely(DAHDI_RXSIG_INITIAL == get_dahdi_chan(wc, mod)->rxhooksig)) {
@@ -2190,8 +2170,8 @@
if (debug & DEBUG_CARD) {
dev_info(&wc->vb.pdev->dev, "Setting FXS hook state "
- "to %d (%02x) intcount=%d\n", txsig, x,
- wc->intcount);
+ "to %d (%02x) framecount=%ld\n", txsig, x,
+ wc->framecount);
}
} else {
spin_unlock_irqrestore(&wc->reglock, flags);
@@ -2366,8 +2346,9 @@
{
struct fxs *const fxs = &mod->mod.fxs;
- if (!(wc->intcount % 10000)) {
+ if (time_after(wc->framecount, fxs->check_alarm)) {
/* Accept an alarm once per 10 seconds */
+ fxs->check_alarm = wc->framecount + (1000*10);
if (fxs->palarms)
fxs->palarms--;
}
@@ -2375,8 +2356,11 @@
wctdm_proslic_check_oppending(wc, mod);
- if (!(wc->intcount & 0xfc)) /* every 256ms */
+ if (time_after(wc->framecount, fxs->check_proslic)) {
+ fxs->check_proslic = wc->framecount + 250; /* every 250ms */
wctdm_proslic_recheck_sanity(wc, mod);
+ }
+
if (SLIC_LF_RINGING == fxs->lasttxhook) {
/* RINGing, prepare for OHT */
fxs->ohttimer = OHT_TIMER << 3;
@@ -2478,7 +2462,7 @@
memset(vbb->data, 0, sizeof(vbb->data));
wctdm_transmitprep(wc, vbb->data);
wctdm_isr_misc(wc);
- wc->intcount++;
+ wc->framecount++;
}
}
Modified: linux/trunk/drivers/dahdi/wctdm24xxp/wctdm24xxp.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wctdm24xxp/wctdm24xxp.h?view=diff&rev=10164&r1=10163&r2=10164
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm24xxp/wctdm24xxp.h (original)
+++ linux/trunk/drivers/dahdi/wctdm24xxp/wctdm24xxp.h Tue Aug 30 11:38:14 2011
@@ -161,6 +161,7 @@
int neonmwi_last_voltage;
unsigned int neonmwi_debounce;
unsigned int neonmwi_offcounter;
+ unsigned long display_fxovoltage;
};
struct fxs {
@@ -187,6 +188,8 @@
int vmwi_linereverse;
int reversepolarity; /* polarity reversal */
struct calregs calregs;
+ unsigned long check_alarm;
+ unsigned long check_proslic;
};
struct qrv {
@@ -242,7 +245,7 @@
spinlock_t frame_list_lock;
struct list_head frame_list;
- unsigned int intcount;
+ unsigned long framecount;
unsigned char txident;
unsigned char rxident;
More information about the dahdi-commits
mailing list