diff options
author | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2004-01-10 22:14:50 +0000 |
---|---|---|
committer | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2004-01-10 22:14:50 +0000 |
commit | 35fe6b60ab4690860e2a2212f8718b2e48450fb8 (patch) | |
tree | 177a0ba10fa30bd1f9396d95a5d161120929dc16 /wct4xxp.c | |
parent | 1bb6d221125d9d2e8838d353e9c0163e268b96ed (diff) |
Revert earlier changes until finished
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@296 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wct4xxp.c')
-rwxr-xr-x | wct4xxp.c | 75 |
1 files changed, 13 insertions, 62 deletions
@@ -3,6 +3,7 @@ * * Written by Mark Spencer <markster@linux-support.net> * Based on previous works, designs, and archetectures conceived and + * written by Jim Dixon <jim@lambdatel.com>. * * Copyright (C) 2001 Jim Dixon / Zapata Telephony. * Copyright (C) 2001, Linux Support Services, Inc. @@ -75,6 +76,8 @@ static int altab[] = { #define CANARY 0xc0de +static int inirq = 0; + struct t4 { /* This structure exists one per card */ struct pci_dev *dev; /* Pointer to PCI device */ @@ -153,7 +156,6 @@ static int t4_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long data); #define WC_GPIO 9 #define WC_LADDR 10 #define WC_LDATA 11 -#define WC_POSITION 12 #define WC_LREAD (1 << 15) #define WC_LWRITE (1 << 16) @@ -968,14 +970,6 @@ static void t4_receiveprep(struct t4 *wc, int irq) wc->spans[1].chans[z].readchunk[x] = (tmp & 0xff0000) >> 16; wc->spans[0].chans[z].readchunk[x] = tmp >> 24; } -#if 0 - if (wc->spans[0].chans[0].readchunk[x] == 0xff) { - static int printed = 0; - if (!(printed++ % 100)) { - printk("Read 255 at position %d/%d\n", wc->last0, x); - } - } -#endif if (wc->t1e1) { if (wc->e1recover > 0) wc->e1recover--; @@ -1324,9 +1318,6 @@ static inline void __handle_leds(struct t4 *wc) #endif } -static int __t4_reset_dma2(struct t4 *wc); -static int __t4_reset_dma3(struct t4 *wc); - #ifdef LINUX26 static irqreturn_t t4_interrupt(int irq, void *dev_id, struct pt_regs *regs) #else @@ -1336,8 +1327,6 @@ static void t4_interrupt(int irq, void *dev_id, struct pt_regs *regs) struct t4 *wc = dev_id; unsigned long flags; int x; - static int irqcount; - static int irqdisp; unsigned int status; #if 0 @@ -1348,46 +1337,22 @@ static void t4_interrupt(int irq, void *dev_id, struct pt_regs *regs) if (wc->intcount < 20) printk("Pre-interrupt\n"); #endif - spin_lock_irqsave(&wc->reglock, flags); + + inirq = 1; /* Make sure it's really for us */ - status = __t4_pci_in(wc, WC_INTR); + status = t4_pci_in(wc, WC_INTR); + t4_pci_out(wc, WC_INTR, 0); /* Ignore if it's not for us */ - if (!status) { - spin_unlock_irqrestore(&wc->lock, flags); + if (!status) #ifdef LINUX26 return IRQ_NONE; #else return; #endif - } - if ((status & 3) == 3) - printk("Got both at the same time? (%08x)\n", status); - - irqcount++; - irqdisp++; - if (!(irqcount % 1000)) { - /* printk("Position: %08x\n", __t4_pci_in(wc, WC_POSITION)); */ - } - if (irqcount == 4000) { - __t4_reset_dma3(wc); - } - if (irqcount == 5000) { - __t4_reset_dma2(wc); - } - if (irqcount == 6000) { - __t4_reset_dma3(wc); - } -#if 0 - if (irqdisp < 8) { - printk("IRQ Status %d: %08x\n", irqdisp, status); - } -#endif if (!wc->spansstarted) { printk("Not prepped yet!\n"); - __t4_pci_out(wc, WC_INTR, 0); - spin_unlock_irqrestore(&wc->reglock, flags); #ifdef LINUX26 return IRQ_NONE; #else @@ -1416,7 +1381,7 @@ static void t4_interrupt(int irq, void *dev_id, struct pt_regs *regs) } } #endif - /* spin_lock_irqsave(&wc->reglock, flags); */ + spin_lock_irqsave(&wc->reglock, flags); __handle_leds(wc); @@ -1437,25 +1402,11 @@ static void t4_interrupt(int irq, void *dev_id, struct pt_regs *regs) __t4_check_alarms(wc, x - 4); break; } - __t4_pci_out(wc, WC_INTR, 0); - spin_unlock_irqrestore(&wc->reglock, flags); -} - -static int __t4_reset_dma2(struct t4 *wc) -{ - printk("DMA Reset part 2\n"); - wc->dmactrl |= (1 << 27); - __t4_pci_out(wc, WC_DMACTRL, wc->dmactrl); - return 0; -} - -static int __t4_reset_dma3(struct t4 *wc) -{ - printk("DMA Reset part 3\n"); - wc->dmactrl &= ~(1 << 27); - __t4_pci_out(wc, WC_DMACTRL, wc->dmactrl); - return 0; + spin_unlock_irqrestore(&wc->reglock, flags); +#ifdef LINUX26 + return IRQ_RETVAL(1); +#endif } static int t4_reset_dma(struct t4 *wc) |