summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/internal.h
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2012-04-13 13:12:53 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-13 18:18:23 (GMT)
commit4d7df821277e82ebe2fc9c9af07c928a83f572b8 (patch)
tree166c802ebf8c67647c85c5cb3f2a2cfa972f8059 /drivers/staging/comedi/internal.h
parentb3201b563d36eb799d3f9e14871d5dda2b11f3e8 (diff)
downloadlinux-fsl-qoriq-4d7df821277e82ebe2fc9c9af07c928a83f572b8.tar.xz
staging: comedi: Add module parameters for default buffer size
For comedi subdevices that support asynchronous transfer commands, the initial buffer size and maximum buffer size for the transfer are both set to 64 KiB when the comedi device is "attached" to the hardware device. For many applications with reasonable fast sample rates and slow user-space (e.g. Python) these sizes are a bit too small. A task with CAP_SYS_ADMIN privileges can change the maximum buffer size for a comedi subdevice with an ioctl call or by writing to a device attribute file in sysfs, but that's not very convenient. For comedi devices attached during system startup, this could be done by a start-up script, but for hot-plugged devices it would require scripts run by udev rules, etc. Rather than use hardwired values, this patch introduces a couple of module parameters to set the defaults for the initial buffer size (comedi_default_buf_size_kb) and maximum buffer size (comedi_default_buf_maxsize_kb). These values are applied in place of the previous hard-wired values when the comedi device is "attached". The module parameter values are in units of KiB for consistency with the existing device attribute files. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/internal.h')
-rw-r--r--drivers/staging/comedi/internal.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/comedi/internal.h b/drivers/staging/comedi/internal.h
index 4208fb4..7ed20a0 100644
--- a/drivers/staging/comedi/internal.h
+++ b/drivers/staging/comedi/internal.h
@@ -1,5 +1,5 @@
/*
- * various internal comedi functions
+ * various internal comedi stuff
*/
int do_rangeinfo_ioctl(struct comedi_device *dev,
struct comedi_rangeinfo __user *arg);
@@ -11,3 +11,6 @@ int comedi_find_board_minor(struct device *hardware_device);
void comedi_reset_async_buf(struct comedi_async *async);
int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s,
unsigned long new_size);
+
+extern unsigned int comedi_default_buf_size_kb;
+extern unsigned int comedi_default_buf_maxsize_kb;