summaryrefslogtreecommitdiff
path: root/wcfxs.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-01-14 22:47:52 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-01-14 22:47:52 +0000
commiteaa0563575c8e4a1081f49b9efb6ea378d981984 (patch)
treeaed3d1c18a17feae26b0e96284ac0433f5d47a3e /wcfxs.c
parent20d38c5728ce21efb81ec11e6b24e1ce7e093d36 (diff)
Version 0.4.0 from FTP
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@142 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wcfxs.c')
-rwxr-xr-xwcfxs.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/wcfxs.c b/wcfxs.c
index 73f6e32..623ca84 100755
--- a/wcfxs.c
+++ b/wcfxs.c
@@ -218,7 +218,7 @@ static inline void wcfxs_receiveprep(struct wcfxs *wc, unsigned char ints)
if (ints & 0x08)
readchunk = wc->readchunk + ZT_CHUNKSIZE;
else
- /* Read is not at interrupt address. Valid data is available at normal offset */
+ /* Read is at interrupt address. Valid data is available at normal offset */
readchunk = wc->readchunk;
for (x=0;x<ZT_CHUNKSIZE;x++) {
if (wc->cardflag & (1 << 0))
@@ -265,7 +265,7 @@ static void wcfxs_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (ints & 0x0f) {
wc->intcount++;
- x = wc->intcount % 10;
+ x = wc->intcount % 4;
if ((x < wc->cards) && (wc->cardflag & (1 << x))) {
wcfxs_check_hook(wc, x);
}
@@ -792,14 +792,14 @@ static inline void wcfxs_check_hook(struct wcfxs *wc, int card)
res = wcfxs_getreg(wc, card, 68);
hook = (res & 1);
if (hook != wc->lastrxhook[card]) {
- /* Reset the debounce */
- wc->debounce[card] = 10;
+ /* Reset the debounce (must be multiple of 4ms) */
+ wc->debounce[card] = 3 * 4 * 8;
#if 0
printk("Resetting debounce card %d hook %d, %d\n", card, hook, wc->debounce[card]);
#endif
} else {
if (wc->debounce[card] > 0) {
- wc->debounce[card]--;
+ wc->debounce[card]-= 4 * ZT_CHUNKSIZE;
#if 0
printk("Sustaining hook %d, %d\n", hook, wc->debounce[card]);
#endif
@@ -1017,11 +1017,11 @@ static int wcfxs_hardware_init(struct wcfxs *wc)
/* Setup DMA Addresses */
outl(wc->writedma, wc->ioaddr + WC_DMAWS); /* Write start */
- outl(wc->writedma + ZT_CHUNKSIZE * 4, wc->ioaddr + WC_DMAWI); /* Middle (interrupt) */
+ outl(wc->writedma + ZT_CHUNKSIZE * 4 - 4, wc->ioaddr + WC_DMAWI); /* Middle (interrupt) */
outl(wc->writedma + ZT_CHUNKSIZE * 8 - 4, wc->ioaddr + WC_DMAWE); /* End */
outl(wc->readdma, wc->ioaddr + WC_DMARS); /* Read start */
- outl(wc->readdma + ZT_CHUNKSIZE * 4, wc->ioaddr + WC_DMARI); /* Middle (interrupt) */
+ outl(wc->readdma + ZT_CHUNKSIZE * 4 - 4, wc->ioaddr + WC_DMARI); /* Middle (interrupt) */
outl(wc->readdma + ZT_CHUNKSIZE * 8 - 4, wc->ioaddr + WC_DMARE); /* End */
/* Clear interrupts */