|
From: Peter S. <pe...@st...> - 2010-06-25 23:04:09
|
Alan Stern wrote: > > > libusb returns -99 (LIBUSB_ERROR_OTHER) > > .. > > > libusb:warning [do_sync_bulk_transfer] unrecognised status code 1 > > > > Alan's description is helpful. libusb does handle when transfer >=2 > > in a multi-URB transfer submitted to Linux fails. libusb discards the > > previous transfers > > Do you mean it discards the as-yet-unsubmitted URBs and cancels the > outstanding URBs? Yep, that's correct. > > and sets reap_action=SUBMIT_FAILED. As libusb is > > reaping the URBs, it notices that one could not be submitted, and > > returns an error. > > I gather that the difficulty is how to tell whether or not a submission > failure represents an error. The criterion is simple: If the errno > value from the failed submission ioctl is EREMOTEIO then it's not an > error (it's merely a rejection because the transer has already > completed), otherwise it is. Thanks for clarifying that! I'm attaching a revised patch to be applied instead of the previous one. The former patch changed the reap code path when URB submission had failed. This patch instead changes the code path directly after submission, and if errno == EREMOTEIO then the reap code is instructed that all is well via reap_action = COMPLETED_EARLY. (libusb already handles this situation correctly when all URBs get submitted and one completes early.) While my guess is that the former patch would work for Ludovic this one is much more correct. Please test it! //Peter |