summaryrefslogtreecommitdiff
path: root/wcfxo.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-11-17 22:06:15 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-11-17 22:06:15 +0000
commitbbb8de18d0e28b295a1d33937959d7e7806dd39e (patch)
tree4c36af70ec81d095dfb2d73cc195dc64cca16bab /wcfxo.c
parent14770f986b1cbe0d8577e7c78256f8fc5867e5c8 (diff)
Rid ourselves of static local variables
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@276 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wcfxo.c')
-rwxr-xr-xwcfxo.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/wcfxo.c b/wcfxo.c
index 8e30e02..1e47285 100755
--- a/wcfxo.c
+++ b/wcfxo.c
@@ -118,6 +118,7 @@ struct wcfxo {
int rreadpos;
unsigned int pegtimer;
int pegcount;
+ int peg;
int battdebounce;
int nobatttimer;
int ringdebounce;
@@ -140,6 +141,9 @@ struct wcfxo {
dma_addr_t writedma;
volatile int *writechunk; /* Double-word aligned write memory */
volatile int *readchunk; /* Double-word aligned read memory */
+#ifdef ZERO_BATT_RING
+ int onhook;
+#endif
#ifdef ENABLE_TASKLETS
int taskletrun;
int taskletsched;
@@ -287,7 +291,6 @@ static inline void wcfxo_receiveprep(struct wcfxo *wc, unsigned char ints)
int realreg;
int realval;
int sample;
- static int peg = 0;
if (ints & 0x04)
/* Read is at interrupt address. Valid data is available at normal offset */
readchunk = wc->readchunk;
@@ -323,12 +326,12 @@ static inline void wcfxo_receiveprep(struct wcfxo *wc, unsigned char ints)
if ((wc->pegtimer < PEGTIME) && (wc->pegtimer > MINPEGTIME))
wc->pegcount++;
wc->pegtimer = 0;
- peg = 1;
+ wc->peg = 1;
} else if ((sample < -32000) && (peg != -1)) {
if ((wc->pegtimer < PEGTIME) && (wc->pegtimer > MINPEGTIME))
wc->pegcount++;
wc->pegtimer = 0;
- peg = -1;
+ wc->peg = -1;
}
wc->chan.readchunk[x] = ZT_LIN2X((sample), (&wc->chan));
}
@@ -389,9 +392,6 @@ static void wcfxo_interrupt(int irq, void *dev_id, struct pt_regs *regs)
struct wcfxo *wc = dev_id;
unsigned char ints;
unsigned char b;
-#ifdef ZERO_BATT_RING
- static int onhook = 0;
-#endif
#ifdef DEBUG_RING
static int oldb = 0;
static int oldcnt = 0;
@@ -451,7 +451,7 @@ static void wcfxo_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (debug)
printk("Signalled On Hook\n");
#ifdef ZERO_BATT_RING
- onhook++;
+ wc->onhook++;
#endif
}
#else
@@ -473,8 +473,8 @@ static void wcfxo_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (debug)
printk("BATTERY!\n");
#ifdef ZERO_BATT_RING
- if (onhook) {
- onhook = 0;
+ if (wc->onhook) {
+ wc->onhook = 0;
zt_hooksig(&wc->chan, ZT_RXSIG_OFFHOOK);
if (debug)
printk("Signalled Off Hook\n");