aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/class/usbtmc.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2009-12-04tree-wide: fix assorted typos all over the placeAndré Goddard Rosa1-1/+1
That is "success", "unknown", "through", "performance", "[re|un]mapping" , "access", "default", "reasonable", "[con]currently", "temperature" , "channel", "[un]used", "application", "example","hierarchy", "therefore" , "[over|under]flow", "contiguous", "threshold", "enough" and others. Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-10-09USB: usbtmc: fix timeout increaseGergely Imreh1-1/+1
The current 10ms timeout is too short for some normal USBTMC device operation, increase it to a value which was tested with previously affected Tektronix oscilloscopes. Signed-off-by: Gergely Imreh <imrehg@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-10-01const: constify remaining file_operationsAlexey Dobriyan1-1/+1
[akpm@linux-foundation.org: fix KVM] Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23USB: fix USBTMC get_capabilities success handlingGergely Imreh1-5/+8
In order: Add reference to relevant section of USBTMC usb488 subclass specs. Print debug output of capabilities only when it was retrieved successfully. Clear return value on success, otherwise driver always reports failure. Signed-off-by: Gergely Imreh <imrehg@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-23USB: usbtmc: correct termination condition for reads.Steve Holland1-1/+2
Follow T&M convention of obeying EOM flag. Avoid exception cases where instrument response size matches a buffer size. Signed-off-by: Steve Holland <sdh4@iastate.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-23USB: usbtmc: inhibit corruptionSteve Holland1-0/+4
Limit data copied to userspace to amount requested. Prevents a faulty instrument from overwriting user memory. Signed-off-by: Steve Holland <sdh4@iastate.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-23USB: usbtmc: Fix short reads in usbtmc_read()Steve Holland1-4/+4
The header size should not be included in the number of bytes requested of the instrument Signed-off-by: Steve Holland <sdh4@iastate.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-23USB: usbtmc: fix printk format warningsRandy Dunlap1-1/+1
Fix printk format warnings: drivers/usb/class/usbtmc.c:466: warning: format '%zu' expects type 'size_t', but argument 4 has type 'u32' drivers/usb/class/usbtmc.c:466: warning: format '%zu' expects type 'size_t', but argument 5 has type 'int' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-23USB: usbtmc: sanity checks for DEV_DEP_MSG_IN urbsGuus Sliepen1-4/+18
According to the specifications, an instrument should not return more data in a DEV_DEP_MSG_IN urb than requested. However, some instruments can send more than requested. This could cause the kernel to write the extra data past the end of the buffer provided by read(). Fix this by checking that the value of the TranserSize field is not larger than the urb itself and not larger than the size of the userspace buffer. Also correctly decrement the remaining size of the buffer when userspace read()s more than USBTMC_SIZE_IOBUFFER. Signed-off-by: Guus Sliepen <guus@sliepen.org> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-23USB: suspend/resume support for usbtmcOliver Neukum1-1/+14
a class driver should have suspend/resume. This makes sure we don't see a virtual disconnect unnecessarily. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-23USB: usbtmc can do IO to device after disconnectOliver Neukum1-0/+19
usbtmc will happily complete read/write requests even after disconnect has returned. The fix is to introduce a flag. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-07-12USB: fix memory leak in usbtmcOliver Neukum1-4/+6
If an error is returned kfree must also be called. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15USB: usbtmc: fix switch statmentGreg Kroah-Hartman1-0/+6
Steve Holland pointed out that we forgot to call break; in the switch statment. This probably resolves a lot of the bug reports I've gotten for the driver lately. Stupid me... Reported-by: Steve Holland <sdh4@iastate.edu> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-03-17USB: usbtmc: add protocol 1 supportGreg Kroah-Hartman1-0/+1
The driver already supports the 1 protocol support, so just add it to the MODULE_DEVICE_TABLE entry so it properly picks up these devices. Thanks to Jouni Rynö for pointing this out. Reported-by: Jouni Ryno <Jouni.Ryno@fmi.fi> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-03-17USB: usbtmc: fix stupid bug in open()Greg Kroah-Hartman1-1/+2
open() will never succeed, as we always return -ENODEV. Fix this obvious bug. Thanks to Jouni Ryno for reporting it. Reported-by: Jouni Ryno <Jouni.Ryno@fmi.fi> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07USB: usbtmc: indent & braces disagree, something else is desiredIlpo Järvinen1-6/+3
It seems that there's rather involved way to say something which is commonly written in a plain simple form. Some type changes would probably be necessary to get gcc to do bitops instead of divide but it's no worse after my change than before I think. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-12-17USB: fix problem with usbtmc driver not loading properlyGreg Kroah-Hartman1-0/+1
The usbtmc driver forgot to export its device table to userspace. Without this, it is never loaded properly when such a device is seen by the system. Cc: Marcel Janssen <marcel.janssen@admesy.nl> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-29USB: usbtmc: Use explicit unsigned type for input buffer instead of char*Chris Malley1-1/+1
Silences compiler warning about comparison with 0x80, and type now matches the corresponding _bulk_out function. drivers/usb/class/usbtmc.c: In function ‘usbtmc_ioctl_abort_bulk_in’: drivers/usb/class/usbtmc.c:163: warning: comparison is always false due to limited range of data type Signed-off-by: Chris Malley <mail@chrismalley.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-17USB: add USB test and measurement class driverGreg Kroah-Hartman1-0/+1087
This driver was originaly written by Stefan Kopp, but massively reworked by Greg for submission. Thanks to Felipe Balbi <me@felipebalbi.com> for lots of work in cleaning up this driver. Thanks to Oliver Neukum <oliver@neukum.org> for reviewing previous versions and pointing out problems. Cc: Stefan Kopp <stefan_kopp@agilent.com> Cc: Marcel Janssen <korgull@home.nl> Cc: Felipe Balbi <me@felipebalbi.com> Cc: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>