diff options
Diffstat (limited to 'wcfxo.c')
-rwxr-xr-x | wcfxo.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -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"); |