blob: 6d0add1e87a14f85eb61b3b4347892e2e69fea64 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef __LINUX_USB_TMC_H
20#define __LINUX_USB_TMC_H
Christopher Ferris9ce28842018-10-25 12:11:39 -070021#include <linux/types.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070022#define USBTMC_STATUS_SUCCESS 0x01
23#define USBTMC_STATUS_PENDING 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -070024#define USBTMC_STATUS_FAILED 0x80
25#define USBTMC_STATUS_TRANSFER_NOT_IN_PROGRESS 0x81
26#define USBTMC_STATUS_SPLIT_NOT_IN_PROGRESS 0x82
27#define USBTMC_STATUS_SPLIT_IN_PROGRESS 0x83
Ben Cheng655a7c02013-10-16 16:09:24 -070028#define USBTMC_REQUEST_INITIATE_ABORT_BULK_OUT 1
29#define USBTMC_REQUEST_CHECK_ABORT_BULK_OUT_STATUS 2
30#define USBTMC_REQUEST_INITIATE_ABORT_BULK_IN 3
31#define USBTMC_REQUEST_CHECK_ABORT_BULK_IN_STATUS 4
Ben Cheng655a7c02013-10-16 16:09:24 -070032#define USBTMC_REQUEST_INITIATE_CLEAR 5
33#define USBTMC_REQUEST_CHECK_CLEAR_STATUS 6
34#define USBTMC_REQUEST_GET_CAPABILITIES 7
35#define USBTMC_REQUEST_INDICATOR_PULSE 64
Christopher Ferris106b3a82016-08-24 12:15:38 -070036#define USBTMC488_REQUEST_READ_STATUS_BYTE 128
37#define USBTMC488_REQUEST_REN_CONTROL 160
38#define USBTMC488_REQUEST_GOTO_LOCAL 161
39#define USBTMC488_REQUEST_LOCAL_LOCKOUT 162
Christopher Ferris86a48372019-01-10 14:14:59 -080040struct usbtmc_request {
41 __u8 bRequestType;
42 __u8 bRequest;
43 __u16 wValue;
44 __u16 wIndex;
45 __u16 wLength;
46} __attribute__((packed));
47struct usbtmc_ctrlrequest {
48 struct usbtmc_request req;
49 void __user * data;
50} __attribute__((packed));
Christopher Ferris9ce28842018-10-25 12:11:39 -070051struct usbtmc_termchar {
52 __u8 term_char;
53 __u8 term_char_enabled;
54} __attribute__((packed));
Christopher Ferris86a48372019-01-10 14:14:59 -080055#define USBTMC_FLAG_ASYNC 0x0001
56#define USBTMC_FLAG_APPEND 0x0002
57#define USBTMC_FLAG_IGNORE_TRAILER 0x0004
58struct usbtmc_message {
59 __u32 transfer_size;
60 __u32 transferred;
61 __u32 flags;
62 void __user * message;
63} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -070064#define USBTMC_IOC_NR 91
65#define USBTMC_IOCTL_INDICATOR_PULSE _IO(USBTMC_IOC_NR, 1)
66#define USBTMC_IOCTL_CLEAR _IO(USBTMC_IOC_NR, 2)
67#define USBTMC_IOCTL_ABORT_BULK_OUT _IO(USBTMC_IOC_NR, 3)
Ben Cheng655a7c02013-10-16 16:09:24 -070068#define USBTMC_IOCTL_ABORT_BULK_IN _IO(USBTMC_IOC_NR, 4)
69#define USBTMC_IOCTL_CLEAR_OUT_HALT _IO(USBTMC_IOC_NR, 6)
70#define USBTMC_IOCTL_CLEAR_IN_HALT _IO(USBTMC_IOC_NR, 7)
Christopher Ferris86a48372019-01-10 14:14:59 -080071#define USBTMC_IOCTL_CTRL_REQUEST _IOWR(USBTMC_IOC_NR, 8, struct usbtmc_ctrlrequest)
Christopher Ferris9ce28842018-10-25 12:11:39 -070072#define USBTMC_IOCTL_GET_TIMEOUT _IOR(USBTMC_IOC_NR, 9, __u32)
73#define USBTMC_IOCTL_SET_TIMEOUT _IOW(USBTMC_IOC_NR, 10, __u32)
74#define USBTMC_IOCTL_EOM_ENABLE _IOW(USBTMC_IOC_NR, 11, __u8)
75#define USBTMC_IOCTL_CONFIG_TERMCHAR _IOW(USBTMC_IOC_NR, 12, struct usbtmc_termchar)
Christopher Ferris86a48372019-01-10 14:14:59 -080076#define USBTMC_IOCTL_WRITE _IOWR(USBTMC_IOC_NR, 13, struct usbtmc_message)
77#define USBTMC_IOCTL_READ _IOWR(USBTMC_IOC_NR, 14, struct usbtmc_message)
78#define USBTMC_IOCTL_WRITE_RESULT _IOWR(USBTMC_IOC_NR, 15, __u32)
79#define USBTMC_IOCTL_API_VERSION _IOR(USBTMC_IOC_NR, 16, __u32)
Christopher Ferris106b3a82016-08-24 12:15:38 -070080#define USBTMC488_IOCTL_GET_CAPS _IOR(USBTMC_IOC_NR, 17, unsigned char)
Christopher Ferris106b3a82016-08-24 12:15:38 -070081#define USBTMC488_IOCTL_READ_STB _IOR(USBTMC_IOC_NR, 18, unsigned char)
82#define USBTMC488_IOCTL_REN_CONTROL _IOW(USBTMC_IOC_NR, 19, unsigned char)
83#define USBTMC488_IOCTL_GOTO_LOCAL _IO(USBTMC_IOC_NR, 20)
84#define USBTMC488_IOCTL_LOCAL_LOCKOUT _IO(USBTMC_IOC_NR, 21)
Christopher Ferris9ce28842018-10-25 12:11:39 -070085#define USBTMC488_IOCTL_TRIGGER _IO(USBTMC_IOC_NR, 22)
Christopher Ferris86a48372019-01-10 14:14:59 -080086#define USBTMC488_IOCTL_WAIT_SRQ _IOW(USBTMC_IOC_NR, 23, __u32)
87#define USBTMC_IOCTL_MSG_IN_ATTR _IOR(USBTMC_IOC_NR, 24, __u8)
88#define USBTMC_IOCTL_AUTO_ABORT _IOW(USBTMC_IOC_NR, 25, __u8)
Christopher Ferrisa9750ed2021-05-03 14:02:49 -070089#define USBTMC_IOCTL_GET_STB _IOR(USBTMC_IOC_NR, 26, __u8)
90#define USBTMC_IOCTL_GET_SRQ_STB _IOR(USBTMC_IOC_NR, 27, __u8)
Christopher Ferris86a48372019-01-10 14:14:59 -080091#define USBTMC_IOCTL_CANCEL_IO _IO(USBTMC_IOC_NR, 35)
92#define USBTMC_IOCTL_CLEANUP_IO _IO(USBTMC_IOC_NR, 36)
Christopher Ferris106b3a82016-08-24 12:15:38 -070093#define USBTMC488_CAPABILITY_TRIGGER 1
94#define USBTMC488_CAPABILITY_SIMPLE 2
95#define USBTMC488_CAPABILITY_REN_CONTROL 2
96#define USBTMC488_CAPABILITY_GOTO_LOCAL 2
Christopher Ferris106b3a82016-08-24 12:15:38 -070097#define USBTMC488_CAPABILITY_LOCAL_LOCKOUT 2
98#define USBTMC488_CAPABILITY_488_DOT_2 4
99#define USBTMC488_CAPABILITY_DT1 16
100#define USBTMC488_CAPABILITY_RL1 32
Christopher Ferris106b3a82016-08-24 12:15:38 -0700101#define USBTMC488_CAPABILITY_SR1 64
102#define USBTMC488_CAPABILITY_FULL_SCPI 128
103#endif