Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

USB: usbtmc: Add USBTMC_IOCTL_GET_STB

This new ioctl reads the status byte (STB) from the device and returns
the STB unmodified to the application. The srq_asserted bit is not taken
into account and not changed.

This ioctl is useful to support non USBTMC-488 compliant devices.

Tested-by: Jian-Wei Wu <jian-wei_wu@keysight.com>
Reviewed-by: Guido Kiener <guido.kiener@rohde-schwarz.com>
Signed-off-by: Dave Penkler <dpenkler@gmail.com>
Link: https://lore.kernel.org/r/20201215155621.9592-3-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dave Penkler and committed by
Greg Kroah-Hartman
c9784e23 3c1037e2

+8
+6
drivers/usb/class/usbtmc.c
··· 2149 2149 file_data->auto_abort = !!tmp_byte; 2150 2150 break; 2151 2151 2152 + case USBTMC_IOCTL_GET_STB: 2153 + retval = usbtmc_get_stb(file_data, &tmp_byte); 2154 + if (retval > 0) 2155 + retval = put_user(tmp_byte, (__u8 __user *)arg); 2156 + break; 2157 + 2152 2158 case USBTMC_IOCTL_CANCEL_IO: 2153 2159 retval = usbtmc_ioctl_cancel_io(file_data); 2154 2160 break;
+2
include/uapi/linux/usb/tmc.h
··· 102 102 #define USBTMC_IOCTL_MSG_IN_ATTR _IOR(USBTMC_IOC_NR, 24, __u8) 103 103 #define USBTMC_IOCTL_AUTO_ABORT _IOW(USBTMC_IOC_NR, 25, __u8) 104 104 105 + #define USBTMC_IOCTL_GET_STB _IOR(USBTMC_IOC_NR, 26, __u8) 106 + 105 107 /* Cancel and cleanup asynchronous calls */ 106 108 #define USBTMC_IOCTL_CANCEL_IO _IO(USBTMC_IOC_NR, 35) 107 109 #define USBTMC_IOCTL_CLEANUP_IO _IO(USBTMC_IOC_NR, 36)