comedi_subdevice *s;
int ret=0;
-DPRINTK("entering do_cmd_ioctl()\n");
if(copy_from_user(&user_cmd,arg,sizeof(comedi_cmd))){
DPRINTK("bad cmd address\n");
return -EFAULT;
goto cleanup;
}
+ ret=s->do_cmdtest(dev,s,&s->cmd);
+
+ if(s->cmd.flags&TRIG_BOGUS || ret){
+ user_cmd=s->cmd;
+ user_cmd.chanlist = NULL;
+ user_cmd.data = NULL;
+ if(copy_to_user(arg,&user_cmd,sizeof(comedi_cmd))){
+ DPRINTK("fault writing cmd\n");
+ ret = -EFAULT;
+ goto cleanup;
+ }
+ ret = -EAGAIN;
+ goto cleanup;
+ }
+
if(!s->prealloc_bufsz){
ret=-ENOMEM;
DPRINTK("no buffer (?)\n");