From d1d9defdc6d582119d29f5d88f810b72bb1837fa Mon Sep 17 00:00:00 2001 From: Dave Penkler Date: Tue, 15 Dec 2020 16:56:20 +0100 Subject: USB: usbtmc: Add separate USBTMC_IOCTL_GET_SRQ_STB This new ioctl only returns the status byte (STB) that was originally sent by the device due to a service request (SRQ) condition. This ioctl checks the srq_asserted bit of the associated file descriptor. If set, the srq_asserted bit is reset and the cached STB with original SRQ information is returned. Otherwise the ioctl returns the error code ENOMSG. This ioctl is useful to support non USBTMC-488 compliant devices. Time sensitive applications can read the cached STB without incurring the cost of an urb transaction over the bus. Tested-by: Jian-Wei Wu Reviewed-by: Guido Kiener Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20201215155621.9592-4-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- include/uapi/linux/usb/tmc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/uapi/linux/usb') diff --git a/include/uapi/linux/usb/tmc.h b/include/uapi/linux/usb/tmc.h index 1e7878fe591f..d791cc58a7f0 100644 --- a/include/uapi/linux/usb/tmc.h +++ b/include/uapi/linux/usb/tmc.h @@ -103,6 +103,7 @@ struct usbtmc_message { #define USBTMC_IOCTL_AUTO_ABORT _IOW(USBTMC_IOC_NR, 25, __u8) #define USBTMC_IOCTL_GET_STB _IOR(USBTMC_IOC_NR, 26, __u8) +#define USBTMC_IOCTL_GET_SRQ_STB _IOR(USBTMC_IOC_NR, 27, __u8) /* Cancel and cleanup asynchronous calls */ #define USBTMC_IOCTL_CANCEL_IO _IO(USBTMC_IOC_NR, 35) -- cgit v1.2.3-59-g8ed1b