linux/include/uapi/linux/usb/tmc.h

/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
 * Copyright (C) 2007 Stefan Kopp, Gechingen, Germany
 * Copyright (C) 2008 Novell, Inc.
 * Copyright (C) 2008 Greg Kroah-Hartman <[email protected]>
 * Copyright (C) 2015 Dave Penkler <[email protected]>
 * Copyright (C) 2018 IVI Foundation, Inc.
 *
 * This file holds USB constants defined by the USB Device Class
 * and USB488 Subclass Definitions for Test and Measurement devices
 * published by the USB-IF.
 *
 * It also has the ioctl and capability definitions for the
 * usbtmc kernel driver that userspace needs to know about.
 */

#ifndef __LINUX_USB_TMC_H
#define __LINUX_USB_TMC_H

#include <linux/types.h>   /* __u8 etc */

/* USB TMC status values */
#define USBTMC_STATUS_SUCCESS
#define USBTMC_STATUS_PENDING
#define USBTMC_STATUS_FAILED
#define USBTMC_STATUS_TRANSFER_NOT_IN_PROGRESS
#define USBTMC_STATUS_SPLIT_NOT_IN_PROGRESS
#define USBTMC_STATUS_SPLIT_IN_PROGRESS

/* USB TMC requests values */
#define USBTMC_REQUEST_INITIATE_ABORT_BULK_OUT
#define USBTMC_REQUEST_CHECK_ABORT_BULK_OUT_STATUS
#define USBTMC_REQUEST_INITIATE_ABORT_BULK_IN
#define USBTMC_REQUEST_CHECK_ABORT_BULK_IN_STATUS
#define USBTMC_REQUEST_INITIATE_CLEAR
#define USBTMC_REQUEST_CHECK_CLEAR_STATUS
#define USBTMC_REQUEST_GET_CAPABILITIES
#define USBTMC_REQUEST_INDICATOR_PULSE
#define USBTMC488_REQUEST_READ_STATUS_BYTE
#define USBTMC488_REQUEST_REN_CONTROL
#define USBTMC488_REQUEST_GOTO_LOCAL
#define USBTMC488_REQUEST_LOCAL_LOCKOUT

struct usbtmc_request {} __attribute__ ((packed));

struct usbtmc_ctrlrequest {} __attribute__ ((packed));

struct usbtmc_termchar {} __attribute__ ((packed));

/*
 * usbtmc_message->flags:
 */
#define USBTMC_FLAG_ASYNC
#define USBTMC_FLAG_APPEND
#define USBTMC_FLAG_IGNORE_TRAILER

struct usbtmc_message {} __attribute__ ((packed));

/* Request values for USBTMC driver's ioctl entry point */
#define USBTMC_IOC_NR
#define USBTMC_IOCTL_INDICATOR_PULSE
#define USBTMC_IOCTL_CLEAR
#define USBTMC_IOCTL_ABORT_BULK_OUT
#define USBTMC_IOCTL_ABORT_BULK_IN
#define USBTMC_IOCTL_CLEAR_OUT_HALT
#define USBTMC_IOCTL_CLEAR_IN_HALT
#define USBTMC_IOCTL_CTRL_REQUEST
#define USBTMC_IOCTL_GET_TIMEOUT
#define USBTMC_IOCTL_SET_TIMEOUT
#define USBTMC_IOCTL_EOM_ENABLE
#define USBTMC_IOCTL_CONFIG_TERMCHAR
#define USBTMC_IOCTL_WRITE
#define USBTMC_IOCTL_READ
#define USBTMC_IOCTL_WRITE_RESULT
#define USBTMC_IOCTL_API_VERSION

#define USBTMC488_IOCTL_GET_CAPS
#define USBTMC488_IOCTL_READ_STB
#define USBTMC488_IOCTL_REN_CONTROL
#define USBTMC488_IOCTL_GOTO_LOCAL
#define USBTMC488_IOCTL_LOCAL_LOCKOUT
#define USBTMC488_IOCTL_TRIGGER
#define USBTMC488_IOCTL_WAIT_SRQ

#define USBTMC_IOCTL_MSG_IN_ATTR
#define USBTMC_IOCTL_AUTO_ABORT

#define USBTMC_IOCTL_GET_STB
#define USBTMC_IOCTL_GET_SRQ_STB

/* Cancel and cleanup asynchronous calls */
#define USBTMC_IOCTL_CANCEL_IO
#define USBTMC_IOCTL_CLEANUP_IO

/* Driver encoded usb488 capabilities */
#define USBTMC488_CAPABILITY_TRIGGER
#define USBTMC488_CAPABILITY_SIMPLE
#define USBTMC488_CAPABILITY_REN_CONTROL
#define USBTMC488_CAPABILITY_GOTO_LOCAL
#define USBTMC488_CAPABILITY_LOCAL_LOCKOUT
#define USBTMC488_CAPABILITY_488_DOT_2
#define USBTMC488_CAPABILITY_DT1
#define USBTMC488_CAPABILITY_RL1
#define USBTMC488_CAPABILITY_SR1
#define USBTMC488_CAPABILITY_FULL_SCPI

#endif