Lines Matching refs:index
203 static void cpwd_toggleintr(struct cpwd *p, int index, int enable) in cpwd_toggleintr() argument
207 (index == -1) ? in cpwd_toggleintr()
209 (p->devs[index].intr_mask); in cpwd_toggleintr()
222 static void cpwd_resetbrokentimer(struct cpwd *p, int index) in cpwd_resetbrokentimer() argument
224 cpwd_toggleintr(p, index, WD_INTR_ON); in cpwd_resetbrokentimer()
225 cpwd_writew(WD_BLIMIT, p->devs[index].regs + WD_LIMIT); in cpwd_resetbrokentimer()
261 static void cpwd_pingtimer(struct cpwd *p, int index) in cpwd_pingtimer() argument
263 if (cpwd_readb(p->devs[index].regs + WD_STATUS) & WD_S_RUNNING) in cpwd_pingtimer()
264 cpwd_readw(p->devs[index].regs + WD_DCNTR); in cpwd_pingtimer()
271 static void cpwd_stoptimer(struct cpwd *p, int index) in cpwd_stoptimer() argument
273 if (cpwd_readb(p->devs[index].regs + WD_STATUS) & WD_S_RUNNING) { in cpwd_stoptimer()
274 cpwd_toggleintr(p, index, WD_INTR_OFF); in cpwd_stoptimer()
277 p->devs[index].runstatus |= WD_STAT_BSTOP; in cpwd_stoptimer()
290 static void cpwd_starttimer(struct cpwd *p, int index) in cpwd_starttimer() argument
293 p->devs[index].runstatus &= ~WD_STAT_BSTOP; in cpwd_starttimer()
295 p->devs[index].runstatus &= ~WD_STAT_SVCD; in cpwd_starttimer()
297 cpwd_writew(p->devs[index].timeout, p->devs[index].regs + WD_LIMIT); in cpwd_starttimer()
298 cpwd_toggleintr(p, index, WD_INTR_ON); in cpwd_starttimer()
301 static int cpwd_getstatus(struct cpwd *p, int index) in cpwd_getstatus() argument
303 unsigned char stat = cpwd_readb(p->devs[index].regs + WD_STATUS); in cpwd_getstatus()
304 unsigned char intr = cpwd_readb(p->devs[index].regs + PLD_IMASK); in cpwd_getstatus()
315 if (intr & p->devs[index].intr_mask) { in cpwd_getstatus()
330 (p->devs[index].runstatus & WD_STAT_BSTOP)) { in cpwd_getstatus()
331 if (p->devs[index].runstatus & WD_STAT_SVCD) { in cpwd_getstatus()
345 if (p->devs[index].runstatus & WD_STAT_SVCD) in cpwd_getstatus()
414 int index = iminor(inode) - WD0_MINOR; in cpwd_ioctl() local
432 cpwd_pingtimer(p, index); in cpwd_ioctl()
442 cpwd_stoptimer(p, index); in cpwd_ioctl()
444 cpwd_starttimer(p, index); in cpwd_ioctl()
452 setopt = cpwd_getstatus(p, index); in cpwd_ioctl()
458 cpwd_starttimer(p, index); in cpwd_ioctl()
465 cpwd_stoptimer(p, index); in cpwd_ioctl()
503 int index = iminor(inode); in cpwd_write() local
506 cpwd_pingtimer(p, index); in cpwd_write()