Re: [PATCH 06/12] usb: usbtmc: Add vendor specific/asynchronous read/write ioctls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Zitat von Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx>:

On Thu, May 17, 2018 at 07:03:30PM +0200, Guido Kiener wrote:
- ioctl USBTMC_IOCTL_WRITE sends an (a)synchronous generic message
  to bulk OUT. The message is split into chunks of 4k (page size).
  Message size is aligned to 32 bit boundaries.

  With flag USBTMC_FLAG_ASYNC the ioctl is non blocking.
  With flag USBTMC_FLAG_APPEND additional urbs are queued and
  out_status/out_transfer_size is not reset. EPOLLOUT | EPOLLWRNORM
  is signaled when all submitted urbs are completed.

- ioctl USBTMC_IOCTL_WRITE_RESULT copies current out_transfer_size
  to given __u64 pointer and returns current out_status of the last
  USBTMC_IOCTL_WRITE call.

- ioctl USBTMC_IOCTL_READ reads an (a)synchronous generic message
  from bulk IN. Depending on transfer_size the function submits one
  (<=4kB) or more urbs (up to 16) with a size of 4k.

  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.

Again, one patch per ioctl please, it makes it easier to review.

And why are you allowing arbitrary bulk messages now?

All VISA applications have specific flavours in dealing with timeout,
algorithms to abort a message and reset a device. VISA applications need
a maximum of freedom in communication with an instrument to quickly react
with workarounds. There is no time to wait several weeks until a kernel
fix repairs a production line.

The current patches are a trade-off to meet the requirements of the
IVI foundation and to give back convenient ioctls (timeout, termchar)
to the community for the traditional usage of the usbtmc driver.

In case of R&S I (hope) we will use the read, write functions for synchronous
calls, and the new ioctls (USBTMC_IOCTL_READ/USBTMC_IOCTL_WRITE) for
asynchronous calls.

We need at least all generic ioctls. Other patches and ioctls for testing
halt conditions and abort we can withdraw.


What good is this spec if everyone goes around it?

thanks,

greg k-h



--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux