summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlexandre Peixoto Ferreira <alexandref75@gmail.com>2013-04-30 00:51:50 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-05-16 17:50:50 -0700
commit8402db5dda3ac167014c143a633efff340aaff5b (patch)
treec319ee51bb6716d3aded0de8b6f611077cf5d1d0 /drivers
parent6523f6d2475df99e441bd742d2a8993f64124ce9 (diff)
USB: usbtmc: Add flag rigol_quirk to usbtmc_device_data
These patches implement a modification of the USBTMC protocol to allow operation with Rigol equipment. Rigol requires that a single TMC request to receive any buffer size and bulk requests to get the data. The original algorithm sends a TMC request for each subset of the data (a single USB transaction). The modification is only active for Rigol equipment, vendor and product set is contained in the array usbtmc_id_quirk. This patch creates the rigol_quirk variable and the arrays for the idvendor and idproduct. Signed-off-by: Alexandre Peixoto Ferreira <alexandref75@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/class/usbtmc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 4c5506ae5e4..c450b047e36 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -31,6 +31,8 @@
#include <linux/usb/tmc.h>
+#define RIGOL 1
+#define USBTMC_HEADER_SIZE 12
#define USBTMC_MINOR_BASE 176
/*
@@ -84,6 +86,8 @@ struct usbtmc_device_data {
u8 bTag_last_write; /* needed for abort */
u8 bTag_last_read; /* needed for abort */
+ u8 rigol_quirk;
+
/* attributes from the USB TMC spec for this device */
u8 TermChar;
bool TermCharEnabled;
@@ -97,6 +101,16 @@ struct usbtmc_device_data {
};
#define to_usbtmc_data(d) container_of(d, struct usbtmc_device_data, kref)
+struct usbtmc_ID_rigol_quirk {
+ __u16 idVendor;
+ __u16 idProduct;
+};
+
+static const struct usbtmc_ID_rigol_quirk usbtmc_id_quirk[] = {
+ { 0x1ab1, 0x0588 },
+ { 0, 0 }
+};
+
/* Forward declarations */
static struct usb_driver usbtmc_driver;