#include <linux/devfs_fs_kernel.h>
#include <linux/device.h>
#include <linux/vmalloc.h>
+#include <linux/fs.h>
#include <linux/comedidev.h>
MODULE_DESCRIPTION("Comedi core module");
MODULE_LICENSE("GPL");
-#ifndef KILL_FASYNC
-#define KILL_FASYNC(a,b,c) kill_fasync(&(a),(b),(c))
-#endif
-
#ifdef CONFIG_COMEDI_DEBUG
int comedi_debug;
MODULE_PARM(comedi_debug, "i");
if(bc.size > async->max_bufsize)
return -EPERM;
- if(s->busy)return -EBUSY;
-
+ if(s->busy)
+ {
+ DPRINTK("subdevice is busy, cannot resize buffer\n");
+ return -EBUSY;
+ }
if(async->mmap_count){
DPRINTK("subdevice is mmapped, cannot resize buffer\n");
return -EBUSY;
/*
COMEDI_SUBDINFO
subdevice info ioctl
-
+
arg:
pointer to array of subdevice info structures
-
+
reads:
none
-
+
writes:
array of subdevice info structures at arg
-
+
*/
static int do_subdinfo_ioctl(comedi_device *dev,comedi_subdinfo *arg,void *file)
{
us->range_type = 0; /* XXX */
}
us->flags = s->flags;
-
+
if(s->busy)
us->subd_flags |= SDF_BUSY;
if(s->busy == file)
us->settling_time_0 = s->settling_time_0;
}
-
+
ret=copy_to_user(arg,tmp,dev->n_subdevices*sizeof(comedi_subdinfo));
-
+
kfree(tmp);
return ret?-EFAULT:0;
/*
COMEDI_CHANINFO
subdevice info ioctl
-
+
arg:
pointer to chaninfo structure
-
+
reads:
chaninfo structure at arg
if(copy_to_user(it.flaglist,s->flaglist,s->n_chan*sizeof(unsigned int)))
return -EFAULT;
}
-
+
if(it.rangelist){
int i;
}
/* This looks arbitrary. It is. */
s->busy=&parse_insn;
-
switch(insn->insn){
case INSN_READ:
ret=s->insn_read(dev,s,insn,data);
/*
COMEDI_LOCK
lock subdevice
-
+
arg:
subdevice number
-
+
reads:
none
-
+
writes:
none
reads:
none
-
+
writes:
none
/*
COMEDI_CANCEL
cancel acquisition ioctl
-
+
arg:
subdevice number
-
+
reads:
nothing
-
+
writes:
nothing
/*
COMEDI_POLL ioctl
instructs driver to synchronize buffers
-
+
arg:
subdevice number
-
+
reads:
nothing
COMEDI_MAJOR, i, 0666 | S_IFCHR, &comedi_fops, NULL);
class_simple_device_add(comedi_class, MKDEV(COMEDI_MAJOR, i), NULL, "comedi%i", i);
}
-
+
comedi_rt_init();
return 0;