From: Fenye F. B. <bao...@gm...> - 2008-08-28 03:46:32
|
The initial value of configuration is set at linux_open(). I think that the value of hdev->idev->cur_config should be set to 1 here, as follows, instead of 0. This default configuration value (zero) will cause the errors in check_req_valid() in the case that debug level is set at 5. Index: src/linux.c =================================================================== --- src/linux.c (revision 164) +++ src/linux.c (working copy) @@ -189,7 +189,7 @@ return (OPENUSB_NO_RESOURCES); } - hdev->idev->cur_config = 0; + hdev->idev->cur_config = 1; hdev->config_value = 1; /* link the handle and the usbi_device */ On Wed, Aug 27, 2008 at 1:30 AM, Lou <lou...@fi...>wrote: > On Mon, Aug 25, 2008 at 10:02:03PM -0400, Michael Lewis wrote: > > On Sat, Aug 23, 2008 at 2:13 AM, Lou <lou...@fi... > >wrote: > > > > > openusb_get_configuration and openusb_set_configuration are documented > > > thusly: > > > > > > > openusb_get_configuration, openusb_set_configuration -- Get the > current > > > > bConfigurationValue of a device, Set a device's bConfigurationValue > > > > > > I have found that, in practice, it doesn't work like that. > [...] > > > > For some reason, this only showed up when I was both setting the > > > configuration and had debug set at level 5. > > > > I will take a look at that, but I can tell you that when you have the > debug > > level set to less than 5, then check_req_valid doesn't really do much, so > > that's probably why you're not seeing the error with other debug levels. > > Cool. > Yeah; I found something that suggested that during my debugging, but > when it became time to write it up, I couldn't find that anymore to cite. > A quick grep showed check_req_valid to be the only place where > openusb_get_configuration is used internally. > > Something I found while trying to figure this out was that when I had > set the configuration (thus check_req_valid was using the wrong index), > it queried the device for a configuration with that index, which was > wrong, and the device told it so by stalling the control endpoint, and > that error wasn't getting handled properly somewhere. This appears to be > what was causing the hangs. The actual error was -32 (EPIPE). > > cacb7880 2504553371 S Ci:2:020:0 s 80 06 0201 0000 0008 8 < > cacb7880 2504555034 C Ci:2:020:0 -32 0 > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Libusb-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libusb-devel > -- Best regards! Fenye Felix Bao bao...@gm... |