diff options
author | mattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2008-05-02 18:09:23 +0000 |
---|---|---|
committer | mattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2008-05-02 18:09:23 +0000 |
commit | c0c25efed7eb51f54399a330f7f59c177503f77b (patch) | |
tree | 225fce0d146c4c601078accb4b6f80b02061de4a /kernel/wct4xxp | |
parent | d471b05a1c259cc18aa1f6ad54733cd608b7a69f (diff) |
Switch to using bitflags instead of variables for stopdma field
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@4224 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'kernel/wct4xxp')
-rw-r--r-- | kernel/wct4xxp/base.c | 11 | ||||
-rw-r--r-- | kernel/wct4xxp/wct4xxp.h | 1 |
2 files changed, 8 insertions, 4 deletions
diff --git a/kernel/wct4xxp/base.c b/kernel/wct4xxp/base.c index 11277a8..b44747b 100644 --- a/kernel/wct4xxp/base.c +++ b/kernel/wct4xxp/base.c @@ -306,7 +306,6 @@ struct t4 { int ledreg; /* LED Register */ unsigned int gpio; unsigned int gpioctl; - int stopdma; /* Set to stop DMA */ int e1recover; /* E1 recovery timer */ spinlock_t reglock; /* lock register access */ int spansstarted; /* number of spans started */ @@ -1429,7 +1428,7 @@ static int t4_shutdown(struct zt_span *span) (!(wc->tspans[1]->span.flags & ZT_FLAG_RUNNING)))) { /* No longer in use, disable interrupts */ printk("TE%dXXP: Disabling interrupts since there are no active spans\n", wc->numspans); - wc->stopdma = 1; + set_bit(T4_STOP_DMA, &wc->checkflag); } else wc->checktiming = 1; spin_unlock_irqrestore(&wc->reglock, flags); @@ -1472,6 +1471,10 @@ static int t4_spanconfig(struct zt_span *span, struct zt_lineconfig *lc) wc->tspans[lc->sync - 1]->psync = span->offset + 1; } wc->checktiming = 1; + + /* Make sure this is clear in case of multiple startup and shutdown + * iterations */ + clear_bit(T4_STOP_DMA, &wc->checkflag); /* If we're already running, then go ahead and apply the changes */ if (span->flags & ZT_FLAG_RUNNING) @@ -2919,7 +2922,7 @@ ZAP_IRQ_HANDLER(t4_interrupt_gen2) unsigned int status; /* Check this first in case we get a spurious interrupt */ - if (unlikely(wc->stopdma)) { + if (unlikely(test_bit(T4_STOP_DMA, &wc->checkflag))) { /* Stop DMA cleanly if requested */ wc->dmactrl = 0x0; t4_pci_out(wc, WC_DMACTRL, 0x00000000); @@ -3734,7 +3737,7 @@ static int t4_hardware_stop(struct t4 *wc) { /* Turn off DMA, leave interrupts enabled */ - wc->stopdma = 1; + set_bit(T4_STOP_DMA, &wc->checkflag); current->state = TASK_UNINTERRUPTIBLE; schedule_timeout((25 * HZ) / 1000); diff --git a/kernel/wct4xxp/wct4xxp.h b/kernel/wct4xxp/wct4xxp.h index 7cb4ed0..df63675 100644 --- a/kernel/wct4xxp/wct4xxp.h +++ b/kernel/wct4xxp/wct4xxp.h @@ -107,6 +107,7 @@ struct t4_regs { #define T4_CHECK_VPM 0 #define T4_LOADING_FW 1 +#define T4_STOP_DMA 2 #define WCT4_GET_REGS _IOW (ZT_CODE, 60, struct t4_regs) |