Re: usb_control_msg() reads 0 bytes in Linux 2.6.23-rc1

Alan Stern <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
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/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.