On Tue, 24 Jul 2007, Pavel Roskin wrote: > However, I think it's wrong to return 0 if more than 0 bytes were > requested. usb_control_msg() is synchronous, and the caller is supposed > to wait for the data. If the function returns and the data is not > there, it should be an error IMHO.
No. The device is always free to return less data than the driver asked for. It isn't an error unless the driver sets URB_SHORT_NOT_OK. usb_control_msg() is called in several places where the caller doesn't know in advance how much data the device has, so it sets transfer_buffer_length to the maximum possible value and gets whatever is available. This shouldn't be an error. Alan Stern ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel