UBUNTU: SAUCE: staging: comedi: Add module parameters for default buffer size
authorIan Abbott <abbotti@mev.co.uk>
Fri, 13 Apr 2012 13:12:53 +0000 (14:12 +0100)
committerLeann Ogasawara <leann.ogasawara@canonical.com>
Wed, 18 Apr 2012 14:41:11 +0000 (07:41 -0700)
commit4be7bceb4a46bc8786772b1b37fbd82554c3ddb7
treebb050fffbef572afaa420768344c35394e48a893
parentf09854baa7b32d2013d8afa940fc68c84c85b1e6
UBUNTU: SAUCE: staging: comedi: Add module parameters for default buffer size

BugLink: http://bugs.launchpad.net/bugs/981234

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>
(backported from commit 4d7df821277e82ebe2fc9c9af07c928a83f572b8 in
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-next)

Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/staging/comedi/comedi_fops.c
drivers/staging/comedi/drivers.c
drivers/staging/comedi/internal.h