On Tue, Feb 12, 2013 at 6:29 PM, Hans de Goede <hdego...@redhat.com> wrote:
> On 02/12/2013 12:54 AM, Pete Batard wrote:
>> On 2013.02.11 14:25, Hans de Goede wrote:
>>> I've taken a quick look at Nathan's proposal, and I plan to do a
>>> (personal) libusbx git tree with Nathan's hotplug code merged into it
>>> sometime this week.
>>
>>> Hmm, I don't see anything inherently Posixy in their API proposal, it
>>> is a straight-forward API where you register a callback, and then have
>>> that called on events.
>>
>> OK, maybe I didn't express myself properly here, but I remember having
>> some concerns while reading the hotplug proposal discussion that some of
>> the features that seemed to be taken for granted on the other platforms
>> may not work quite as well on Windows.
>>
>> Personally, the first thing I want out of hotplug from a libusbx/Windows
>> standpoint is to provide applications with the ability to notify users,
>> who have just plugged a device, that they may need to install a libusbx
>> compatible driver before they can access it. This means that hotplug
>> *must* include driverless device handling on Windows, so that we (or
>> rather the app developer) has the ability to tell end users: "Hey, I see
>> you've inserted a device, but I can't communicate with it yet. How about
>> we try to do something about that?".
>
> <adding Nathan to the CC, since he is bound to be interested in this too>
>
> Oh, yes I definitely want this, this is a must have feature for spice's
> usb redirection code, and that is what pays the bills :)
>
> I think we can easily do this with Nathan's proposal, currently
> when registering the callback you specify an event mask your interested in
> and when the callback gets called you get an event type passed in. Currently
> the following events are defined:
>
> LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED: A device has arrived and is ready to use
> LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT: A device has left and is no longer available
>
> Not the best names ever, I would have called them ADDED / REMOVED, but
> workable :)  We can simply add:
>
> LIBUSB_HOTPLUG_EVENT_DRIVERLESS_DEVICE_ARRIVED
> LIBUSB_HOTPLUG_EVENT_DRIVERLESS_DEVICE_LEFT
>
> Event types, and generate those in the driverless case, apps which don't
> know how to deal with these won't include them in their event mask and
> never see them, where as apps which are interested can request them
> and differentiate between usable devices, and devices which have
> (some ?) descriptors filled in but are otherwise not usable.
>

What about device suspend/resume? Will it cause the device to
arrive/left? I am not so sure if the behavior of suspend/resume
is the same or compatible across different OS (main ones first,
Windows, Mac OS X and Linux).


-- 
Xiaofan

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to