From: David Schleef Date: Fri, 20 Dec 2002 23:29:41 +0000 (+0000) Subject: Patch from tomasz for INSN_INITTRIG X-Git-Tag: r0_7_67x~135 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=eec77d0aabfbadb6feee3bdff1aceb990b990393;p=comedi.git Patch from tomasz for INSN_INITTRIG --- diff --git a/comedi/kcomedilib/kcomedilib_main.c b/comedi/kcomedilib/kcomedilib_main.c index f07e1ba3..586199ba 100644 --- a/comedi/kcomedilib/kcomedilib_main.c +++ b/comedi/kcomedilib/kcomedilib_main.c @@ -214,6 +214,30 @@ int comedi_do_insn(comedi_t *d,comedi_insn *insn) udelay(insn->data[0]); ret=1; break; + case INSN_INTTRIG: + if(insn->n!=1){ + ret=-EINVAL; + break; + } + if(insn->subdev>=dev->n_subdevices){ + rt_printk("%d not usable subdevice\n",insn->subdev); + ret=-EINVAL; + break; + } + s=dev->subdevices+insn->subdev; + if(!s->async){ + rt_printk("no async\n"); + ret=-EINVAL; + break; + } + if(!s->async->inttrig){ + rt_printk("no inttrig\n"); + ret=-EAGAIN; + break; + } + ret = s->async->inttrig(dev,s,insn->data[0]); + if(ret>=0)ret = 1; + break; default: ret = -EINVAL; }