usb: usbtmc: Add vendor specific/asynchronous read/write ioctls
Greg Kroah-Hartman
maintainerPATCH 6/12 usb: usbtmc: Add vendor specific/asynchronous read/write ioctls
Quoted 17 lines · Guido Kiener
- ioctl
USBTMC_IOCTL_WRITEsends 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_ASYNCthe ioctl is non blocking. With flagUSBTMC_FLAG_APPENDadditional 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_RESULTcopies currentout_transfer_sizeto given__u64pointer and returns currentout_statusof the lastUSBTMC_IOCTL_WRITEcall.- ioctl
USBTMC_IOCTL_READreads an (a)synchronous generic message from bulk IN. Depending ontransfer_sizethe function submits one (<=4kB) or more urbs (up to 16) with a size of 4k.
Quoted 6 lines
The flag
USBTMC_FLAG_IGNORE_TRAILERcan be used when the transmission size is already known. Then the function does not truncate thetransfer_sizeto 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?
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html