From c0c25efed7eb51f54399a330f7f59c177503f77b Mon Sep 17 00:00:00 2001 From: mattf Date: Fri, 2 May 2008 18:09:23 +0000 Subject: 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 --- kernel/wct4xxp/base.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'kernel/wct4xxp/base.c') 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); -- cgit v1.2.3