Closed JosephLutz closed 1 year ago
In the driver bytes four through seven of the MSG_OUT header are initialised with the user specified message transfer size (aka count, see line 1596 in usbtmc.c). This does not include any alignment or header overhead. Alignment padding occurs only on the last URB if needed since the allocated buffer size is always a multiple of 4 bytes. The transfer size passed in the MSG_OUT header is independent of any alignment padding.
I found that the problem I was experiencing was not due to the driver but because of the devices firmware
The driver is not working the way the USBTMC specification states it should. The specification states that the TransferSize should not include the alignment bytes. I am referring to the DEV_DEP_MSG_OUT Bulk-OUT header. In there, bytes four through seven represent the TransferSize. This transfer size is the total number of USBTMC message data bytes to be sent in this USB transfer. This does not include the number of bytes in this Bulk-OUT Header or alignment bytes. The kernel driver is including the alignment bytes in the transfer size.