summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/usb/charger.h
diff options
context:
space:
mode:
authorGuido Kiener2018-09-12 10:50:54 +0200
committerGreg Kroah-Hartman2018-09-20 13:04:02 +0200
commitbb99794a4792068cb4bfd40e99e0f9d8fe7872fa (patch)
tree47cf633743de2d9bddba4066aba56dfd22abdfc8 /include/uapi/linux/usb/charger.h
parentusb: usbtmc: Add ioctl USBTMC_IOCTL_WRITE_RESULT (diff)
downloadkernel-qcow2-linux-bb99794a4792068cb4bfd40e99e0f9d8fe7872fa.tar.gz
kernel-qcow2-linux-bb99794a4792068cb4bfd40e99e0f9d8fe7872fa.tar.xz
kernel-qcow2-linux-bb99794a4792068cb4bfd40e99e0f9d8fe7872fa.zip
usb: usbtmc: Add ioctl for vendor specific read
The USBTMC_IOCTL_READ call provides for generic synchronous and asynchronous reads on bulk IN to implement vendor specific library routines. Depending on transfer_size the function submits one or more urbs (up to 16) each with a size of up to 4kB. The flag USBTMC_FLAG_IGNORE_TRAILER can be used when the transmission size is already known. Then the function does not truncate the transfer_size to a multiple of 4 kB, but does reserve extra space to receive the final short or zero length packet. Note that the instrument is allowed to send up to wMaxPacketSize - 1 bytes at the end of a message to avoid sending a zero length packet. With flag USBTMC_FLAG_ASYNC the ioctl is non blocking. When no received data is available, the read function submits as many urbs as needed to receive transfer_size bytes. However the number of flying urbs (=4kB) is limited to 16 even with subsequent calls of this ioctl. Returns -EAGAIN when non blocking and no data is received. Signals EPOLLIN | EPOLLRDNORM when asynchronous urbs are ready to be read. In non blocking mode the usbtmc_message.message pointer may be NULL and the ioctl just submits urbs to initiate receiving data. However if data is already available due to a previous non blocking call the ioctl will return -EINVAL when the message pointer is NULL. This ioctl does not support compatibility for 32 bit applications running on 64 bit systems. However all other convenient ioctls of the USBTMC driver can still be used in 32 bit applications as well. Note that 32 bit applications running on 32 bit target systems are not affected by this limitation. Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com> Reviewed-by: Steve Bayless <steve_bayless@keysight.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/uapi/linux/usb/charger.h')
0 files changed, 0 insertions, 0 deletions