[dahdi-commits] sruffell: branch linux/sruffell/wctdm24xxp-updates r10130 - /linux/team/sruff...
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Fri Aug 12 19:36:24 CDT 2011
Author: sruffell
Date: Fri Aug 12 19:36:20 2011
New Revision: 10130
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10130
Log:
wctdm24xxp: 'oppending_ms' shouldn't assume being checked at 1ms intervals.
Part of preparations for being able to optionally slow the interrupt
rate down.
Signed-off-by: Shaun Ruffell <sruffell at digium.com>
Modified:
linux/team/sruffell/wctdm24xxp-updates/drivers/dahdi/wctdm24xxp/base.c
linux/team/sruffell/wctdm24xxp-updates/drivers/dahdi/wctdm24xxp/wctdm24xxp.h
Modified: linux/team/sruffell/wctdm24xxp-updates/drivers/dahdi/wctdm24xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/sruffell/wctdm24xxp-updates/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=10130&r1=10129&r2=10130
==============================================================================
--- linux/team/sruffell/wctdm24xxp-updates/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/team/sruffell/wctdm24xxp-updates/drivers/dahdi/wctdm24xxp/base.c Fri Aug 12 19:36:20 2011
@@ -1643,7 +1643,14 @@
return 0;
}
-/* 1ms interrupt */
+/**
+ * wctdm_proslic_check_oppending -
+ *
+ * Ensures that a write to the line feed register on the SLIC has been
+ * processed. If it hasn't after the timeout value, then it will resend the
+ * command and wait for another timeout period.
+ *
+ */
static void
wctdm_proslic_check_oppending(struct wctdm *wc, struct wctdm_module *const mod)
{
@@ -1664,7 +1671,6 @@
if ((fxs->linefeed_control_shadow & SLIC_LF_SETMASK) ==
(fxs->lasttxhook & SLIC_LF_SETMASK)) {
fxs->lasttxhook &= SLIC_LF_SETMASK;
- fxs->oppending_ms = 0;
if (debug & DEBUG_CARD) {
dev_info(&wc->vb.pdev->dev,
"SLIC_LF OK: card=%d shadow=%02x "
@@ -1672,7 +1678,10 @@
fxs->linefeed_control_shadow,
fxs->lasttxhook, wc->framecount);
}
- } else if (fxs->oppending_ms && (--fxs->oppending_ms == 0)) {
+ } else if (time_after(wc->framecount, fxs->oppending_timeout)) {
+ /* Check again in 100 ms */
+ fxs->oppending_timeout = wc->framecount + 100;
+
wctdm_setreg_intr(wc, mod, LINE_STATE, fxs->lasttxhook);
if (debug & DEBUG_CARD) {
dev_info(&wc->vb.pdev->dev,
@@ -1681,9 +1690,8 @@
fxs->linefeed_control_shadow,
fxs->lasttxhook, wc->framecount);
}
- } else { /* Start 100ms Timeout */
- fxs->oppending_ms = 100;
- }
+ }
+
spin_unlock(&wc->reglock);
}
@@ -1750,6 +1758,7 @@
}
fxs->lasttxhook |= SLIC_LF_OPPENDING;
mod->sethook = CMD_WR(LINE_STATE, fxs->lasttxhook);
+ fxs->oppending_timeout = wc->framecount + 100;
/* Update shadow register to avoid extra power alarms
* until next read */
@@ -2188,6 +2197,7 @@
if (x != fxs->lasttxhook) {
fxs->lasttxhook = x | SLIC_LF_OPPENDING;
mod->sethook = CMD_WR(LINE_STATE, fxs->lasttxhook);
+ fxs->oppending_timeout = wc->framecount + 100;
spin_unlock_irqrestore(&wc->reglock, flags);
if (debug & DEBUG_CARD) {
Modified: linux/team/sruffell/wctdm24xxp-updates/drivers/dahdi/wctdm24xxp/wctdm24xxp.h
URL: http://svnview.digium.com/svn/dahdi/linux/team/sruffell/wctdm24xxp-updates/drivers/dahdi/wctdm24xxp/wctdm24xxp.h?view=diff&rev=10130&r1=10129&r2=10130
==============================================================================
--- linux/team/sruffell/wctdm24xxp-updates/drivers/dahdi/wctdm24xxp/wctdm24xxp.h (original)
+++ linux/team/sruffell/wctdm24xxp-updates/drivers/dahdi/wctdm24xxp/wctdm24xxp.h Fri Aug 12 19:36:20 2011
@@ -182,7 +182,6 @@
* voicebus ISR.
*/
int lasttxhook;
- int oppending_ms;
u8 linefeed_control_shadow;
u8 hook_state_shadow;
int palarms;
@@ -193,6 +192,7 @@
struct calregs calregs;
unsigned long check_alarm;
unsigned long check_proslic;
+ unsigned long oppending_timeout;
};
struct qrv {
More information about the dahdi-commits
mailing list