dpenkler / linux-usbtmc

Experimental linux usbtmc driver
GNU General Public License v2.0
21 stars 12 forks source link

Issue with TransferSize in DEV_DEP_MSG_OUT headder #7

Closed JosephLutz closed 1 year ago

JosephLutz commented 1 year ago

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.

dpenkler commented 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.

JosephLutz commented 1 year ago

I found that the problem I was experiencing was not due to the driver but because of the devices firmware