History

Add ioctl to retrieve USBTMC-USB488 capabilities

This is a convenience function to obtain an instrument's capabilities from its file descriptor without having to access sysfs from the user program.

Dave Penkler committed 10 years ago

Commit 29779d81 parent eb6b92e2 files · +30 −3Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/usb/tmc.h+18−3
@@ -2,12 +2,14 @@ · 1 unmodified line
2 * Copyright (C) 2007 Stefan Kopp, Gechingen, Germany2 * Copyright (C) 2007 Stefan Kopp, Gechingen, Germany
3 * Copyright (C) 2008 Novell, Inc.3 * Copyright (C) 2008 Novell, Inc.
4 * Copyright (C) 2008 Greg Kroah-Hartman <gregkh@suse.de>4 * Copyright (C) 2008 Greg Kroah-Hartman <gregkh@suse.de>
5 * Copyright (C) 2015 Dave Penkler <dpenkler@gmail.com>
5 *6 *
6 * This file holds USB constants defined by the USB Device Class7 * This file holds USB constants defined by the USB Device Class
7 * Definition for Test and Measurement devices published by the USB-IF.8 * and USB488 Subclass Definitions for Test and Measurement devices
9 * published by the USB-IF.
8 *10 *
9 * It also has the ioctl definitions for the usbtmc kernel driver that11 * It also has the ioctl and capability definitions for the
10 * userspace needs to know about.12 * usbtmc kernel driver that userspace needs to know about.
11 */13 */
12 14
13#ifndef __LINUX_USB_TMC_H15#ifndef __LINUX_USB_TMC_H
@@ -40,6 +42,19 @@ · 26 unmodified lines
40#define USBTMC_IOCTL_ABORT_BULK_IN _IO(USBTMC_IOC_NR, 4)42#define USBTMC_IOCTL_ABORT_BULK_IN _IO(USBTMC_IOC_NR, 4)
41#define USBTMC_IOCTL_CLEAR_OUT_HALT _IO(USBTMC_IOC_NR, 6)43#define USBTMC_IOCTL_CLEAR_OUT_HALT _IO(USBTMC_IOC_NR, 6)
42#define USBTMC_IOCTL_CLEAR_IN_HALT _IO(USBTMC_IOC_NR, 7)44#define USBTMC_IOCTL_CLEAR_IN_HALT _IO(USBTMC_IOC_NR, 7)
45#define USBTMC488_IOCTL_GET_CAPS _IOR(USBTMC_IOC_NR, 17, unsigned char)
43#define USBTMC488_IOCTL_READ_STB _IOR(USBTMC_IOC_NR, 18, unsigned char)46#define USBTMC488_IOCTL_READ_STB _IOR(USBTMC_IOC_NR, 18, unsigned char)
44 47
48/* Driver encoded usb488 capabilities */
49#define USBTMC488_CAPABILITY_TRIGGER 1
50#define USBTMC488_CAPABILITY_SIMPLE 2
51#define USBTMC488_CAPABILITY_REN_CONTROL 2
52#define USBTMC488_CAPABILITY_GOTO_LOCAL 2
53#define USBTMC488_CAPABILITY_LOCAL_LOCKOUT 2
54#define USBTMC488_CAPABILITY_488_DOT_2 4
55#define USBTMC488_CAPABILITY_DT1 16
56#define USBTMC488_CAPABILITY_RL1 32
57#define USBTMC488_CAPABILITY_SR1 64
58#define USBTMC488_CAPABILITY_FULL_SCPI 128
59
45#endif60#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t