summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Ellero <luca.ellero@brickedbrain.com>2014-09-19 13:50:34 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-19 15:58:18 -0700
commitaa66cd164b592dc994cae4865415a3dccea15fa9 (patch)
tree23063c982c627eebac11db50a800180342b39753
parentaff5b1f8eb71b64bb613dc64c50b6904e89f79b9 (diff)
staging: comedi: ni_usb6501: add counter commands
Signed-off-by: Luca Ellero <luca.ellero@brickedbrain.com> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/comedi/drivers/ni_usb6501.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/drivers/staging/comedi/drivers/ni_usb6501.c b/drivers/staging/comedi/drivers/ni_usb6501.c
index 6a4f965ab79e..f0b8f1108e55 100644
--- a/drivers/staging/comedi/drivers/ni_usb6501.c
+++ b/drivers/staging/comedi/drivers/ni_usb6501.c
@@ -98,6 +98,24 @@ static const u8 SET_PORT_DIR_REQUEST[] = {0x00, 0x01, 0x00, 0x18,
0x00, 0x00, 0x05, 0x00,
0x00, 0x00, 0x00, 0x00};
+/* Counter request packets */
+static const u8 START_COUNTER_REQUEST[] = {0x00, 0x01, 0x00, 0x0C,
+ 0x00, 0x08, 0x01, 0x09,
+ 0x02, 0x20, 0x00, 0x00};
+
+static const u8 STOP_COUNTER_REQUEST[] = {0x00, 0x01, 0x00, 0x0C,
+ 0x00, 0x08, 0x01, 0x0C,
+ 0x02, 0x20, 0x00, 0x00};
+
+static const u8 READ_COUNTER_REQUEST[] = {0x00, 0x01, 0x00, 0x0C,
+ 0x00, 0x08, 0x01, 0x0E,
+ 0x02, 0x20, 0x00, 0x00};
+
+static const u8 WRITE_COUNTER_REQUEST[] = {0x00, 0x01, 0x00, 0x10,
+ 0x00, 0x0C, 0x01, 0x0F,
+ 0x02, 0x20, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00};
+
/* Response packets */
static const u8 GENERIC_RESPONSE[] = {0x00, 0x01, 0x00, 0x0C,
0x00, 0x08, 0x01, 0x00,
@@ -108,10 +126,19 @@ static const u8 READ_PORT_RESPONSE[] = {0x00, 0x01, 0x00, 0x10,
0x00, 0x00, 0x00, 0x02,
0x00, 0x03, 0x00, 0x00};
+static const u8 READ_COUNTER_RESPONSE[] = {0x00, 0x01, 0x00, 0x10,
+ 0x00, 0x0C, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x02,
+ 0x00, 0x00, 0x00, 0x00};
+
enum commands {
READ_PORT,
WRITE_PORT,
- SET_PORT_DIR
+ SET_PORT_DIR,
+ START_COUNTER,
+ STOP_COUNTER,
+ READ_COUNTER,
+ WRITE_COUNTER
};
struct ni6501_private {