diff options
Diffstat (limited to 'wctdm.c')
-rwxr-xr-x | wctdm.c | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -880,6 +880,13 @@ static int wcfxs_open(struct zt_chan *chan) return 0; } +static int wcfxs_watchdog(struct zt_span *span, int event) +{ + printk("FXS: Restarting DMA\n"); + wcfxs_restart_dma(span->pvt); + return 0; +} + static int wcfxs_close(struct zt_chan *chan) { struct wcfxs *wc = chan->pvt; @@ -949,6 +956,7 @@ static int wcfxs_initialize(struct wcfxs *wc) wc->span.close = wcfxs_close; wc->span.flags = ZT_FLAG_RBS; wc->span.ioctl = wcfxs_ioctl; + wc->span.watchdog = wcfxs_watchdog; init_waitqueue_head(&wc->span.maintq); wc->span.pvt = wc; @@ -1058,20 +1066,19 @@ static void wcfxs_enable_interrupts(struct wcfxs *wc) outb(0x00, wc->ioaddr + WC_MASK1); } -static void wcfxs_start_dma(struct wcfxs *wc) +static void wcfxs_restart_dma(struct wcfxs *wc) { /* Reset Master and TDM */ - outb(0x0f, wc->ioaddr + WC_CNTL); - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(1); outb(0x01, wc->ioaddr + WC_CNTL); outb(0x01, wc->ioaddr + WC_OPER); } -static void wcfxs_restart_dma(struct wcfxs *wc) +static void wcfxs_start_dma(struct wcfxs *wc) { - int x; /* Reset Master and TDM */ + outb(0x0f, wc->ioaddr + WC_CNTL); + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(1); outb(0x01, wc->ioaddr + WC_CNTL); outb(0x01, wc->ioaddr + WC_OPER); } |