Re: [Libusb-devel] Chapter 9 tool for linux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 3, 2010 at 10:27 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> On Tue, 3 Aug 2010, Xiaofan Chen wrote:
>
>> On Mon, Aug 2, 2010 at 6:22 PM, Felipe Balbi
>> <felipebalbi@xxxxxxxxxxxxxxxxxxxxx> wrote:
>> >> Another one is that libusb caches the descriptors, so subsequent
>> >> get descriptor requests will just return the cached version, but USBCV
>> >> that's a no-no since we need to exercise a real GetDescriptor() request.
>> >> I understand why libusb does that (to avoid waking up a sleeping device),
>> >> but would there be a way to overcome that ?
>> >>
>>
>> I like this idea. I believe it is necessary to wake up the device
>> sometimes. Maybe a flag (refresh or similar) can be added to the
>> libusb-1.0 APIs related to the descriptor so that a "fresh" copy of the
>> descriptors can be read from the device.
>> http://libusb.sourceforge.net/api-1.0/group__desc.html
>
> USBCV is such a specialized application that I wouldn't recommend
> changing libusb just to accomodate it.  Besides, you can always send
> the Get-Descriptor request yourself, as a normal control transfer,
> rather than relying on libusb_get_descriptor.
>

I see. Thanks for the explanation.

The reason I would like to use a refresh is to wake up the device
without opening it again.

>Under Linux, a suspended device will be woken up as soon as
> libusb opens the device file.

Then why libusb caches the descriptors if avoiding to wake up a
sleeping device is the goal?

-- 
Xiaofan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux