History log of /external/libusb/libusb/hotplug.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1fd08a1513dc323ddf7fae97888eb09215a1f0b6 19-Jan-2016 Stefan Tauner <stefan.tauner@gmx.at> Replace obsolete usleep with nanosleep

This fixes compiling libusb with uclibc.

Closes #141, #165

Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at>
/external/libusb/libusb/hotplug.c
7ee92df12adb8015451aaecfeccd7dd62cc2314e 24-Feb-2016 Chris Dickens <christopher.a.dickens@gmail.com> Misc: Prefix doxygen references in order to namespace libusb

This change add "libusb_" to every group and page definition (and
updates all references accordingly) so that generated man pages
are namespaced for libusb, thus avoiding possible conflict with
other packages.

Closes #131

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
/external/libusb/libusb/hotplug.c
8a0c14372f98d56529556f18126a42fda2ab0137 24-Feb-2016 Chris Dickens <christopher.a.dickens@gmail.com> Misc: Make API parameter names consistent and sensible

Prior to this commit, API functions taking a libusb_device_handle
argument had the parameter named dev, handle, or dev_handle. This
commit changes the name of all libusb_device_handle parameters to
dev_handle in both the documentation and actual code.

Closes #132

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
/external/libusb/libusb/hotplug.c
960a6e7506c4d0d59052056ae2ebfffbe8587175 10-Sep-2015 Chris Dickens <christopher.a.dickens@gmail.com> core: Prevent attempts to recursively hande events

Prior to this commit, it was possible to call certain functions from
within a hotplug or transfer completion callback that would in turn
attempt to handle events (e.g. any of the sync transfer APIs). This
is dangerous because certain events may cause the nested calls to
free memory that is currently in use by the previous calls.

This implementation uses thread-local storage to store a key within
the context that is set to a non-NULL value whenever event handling
is occurring. This allows us to detect when dangerous calls are made
from within event handling context. Such calls will return an error
code of LIBUSB_ERROR_BUSY.

Note that this implementation was chosen because of its portability.
It is supported on all platforms that libusb supports.

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
/external/libusb/libusb/hotplug.c
542fd04e021ce8a268c88b5e93ce191569fdc9eb 06-Jan-2015 Chris Dickens <christopher.a.dickens@gmail.com> Fixing erroneous double semi-colon
/external/libusb/libusb/hotplug.c
89b5407b9aa74790a64b6f32a5b14a96242ba128 18-Nov-2014 Chris Dickens <christopher.a.dickens@gmail.com> core: Signal the event pipe at most one time

This change will ensure that the event pipe is only signalled
at most one time during the course of any incoming events. New
events that occur while the event pipe is in the signalled state
will not cause the event pipe to be signalled again.

This change will provide support for the use of native events on
the Windows/WinCE backends, as these events are binary and do not
"count" the number of times they are signalled.

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
/external/libusb/libusb/hotplug.c
3b371f1a6ab30bdebdadfcde1b96a9b98fb806ca 18-Nov-2014 Chris Dickens <christopher.a.dickens@gmail.com> core: Eliminate hotplug pipe, using list and event pipe instead

To further consolidate libusb internal events, this change removes
the hotplug pipe. Hotplug messages are now kept in a list within the
context, and the event pipe is signalled when a new hotplug message
is added. When handling events, the hotplug messages will be processed
from the list instead of from a separate pipe.

This change is greatly beneficial for the Windows/WinCE backends which
do not allow pipes to be used in the WaitFor* functions.

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
/external/libusb/libusb/hotplug.c
de6130dc0d09d1416ca7f5bc6af80c04b2e2f840 16-Dec-2014 Ludovic Rousseau <ludovic.rousseau@gmail.com> Doxygen: fix a duplicate label

libusb/hotplug.c:46: warning: multiple use of section label 'intro'
while adding section, (first occurrence: libusb/core.c, line 79)

Use label "hotplug_intro" instead of "intro"
/external/libusb/libusb/hotplug.c
93de199d8d60822fc42b1cbf8b920132cd8bbbc6 02-Feb-2014 Markus Heidelberg <markus.heidelberg@web.de> Documentation: fix hotplug example

* add a missing call to libusb_handle_events_completed()
* add a missing argument to libusb_hotplug_deregister_callback()
/external/libusb/libusb/hotplug.c
1eff220474f63d7ea7f8f99bef2a3da9da5324eb 09-Jan-2014 hjelmn@cs.unm.edu <hjelmn@cs.unm.edu> Misc: Revert all references to libusb/libusb.info
/external/libusb/libusb/hotplug.c
def6a8f879e77bbf1606e21f8dc8d7335da9d381 02-Sep-2013 Xiaofan Chen <xiaofanc@gmail.com> Windows: Address an VS2012/x64 warning in hotplug.c

..\libusb\hotplug.c(255): warning C4244: '=' : conversion from
'ssize_t' to 'int', possible loss of data
/external/libusb/libusb/hotplug.c
0fc304da83595da9830bf368f66312ffd793f10c 21-Aug-2013 Hans de Goede <hdegoede@redhat.com> hotplug: Document that callbacks cannot unregister themselves when called from hotplug_register_callback

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
/external/libusb/libusb/hotplug.c
be76bef5b716d27b78fba120d3f9b815ed3380b9 21-Aug-2013 Hans de Goede <hdegoede@redhat.com> hotplug: Don't call the user callback while holding various locks

Calling user callbacks with locks held is a bad idea and should be avoided
whenever possible. Before this patch this could lead ie to the following hang:

1) User calls libusb_hotplug_register_callback with the
LIBUSB_HOTPLUG_ENUMERATE flag
2) libusb_hotplug_register_callback calls the user callback while holding the
hotplug_cbs_lock
3) The callback calls a synchronous libusb function
4) The synchronous libusb function calls libusb_handle_events
5) There is an hotplug event waiting in the hotplug pipe and
libusb_handle_events calls usbi_hotplug_match
6) usbi_hotplug_match tries to take the lock a 2nd time
7) hang / assert / abort (depending on the platform)

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
/external/libusb/libusb/hotplug.c
707d500b9fea002f075cf30458a602f28dbd1348 24-Jul-2013 Nathan Hjelm <hjelmn@me.com> keep a reference to the device for each active transfer and let the backend handle cancelling active transfers when a device is disconnected

This commit should fix issues with active transfers when a device is
disconnected. The backend is responsible for making sure the completion
callbacks are made, not the hotplug code. This should fix a number of
issues including duplicate callbacks and segmentation faults.

References #124.
/external/libusb/libusb/hotplug.c
97958ba756b2f90aa9f65cc7674bc558768dde9f 12-Jul-2013 Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com> hotplug: Pass explicit context to callbacks

* Instead of passing NULL for the context to hotplug callbacks, if the
context happens to be the default context, always pass the explicit
context pointer.
/external/libusb/libusb/hotplug.c
ac41bfc0fdcf2229fbeb19cdf802cc6b551fd365 04-Jul-2013 Hans de Goede <hdegoede@redhat.com> hotplug: Wakeup libusb_handle_events on libusb_hotplug_deregister_callback

This serves 2 purposes:

1) We use lazy free-ing of the callback structure, for it to be actually
free-ed usbi_hotplug_match() needs to be called. This ensures this actually
happens (rather then waiting for a hotplug event to arrive, and not freeing
the callback as long as no such event arrives).

2) It causes libusb_handle_events to return to its caller on a call to
libusb_hotplug_deregister_callback, which is very useful for apps which use
a thread to do their apps (hotplug) event handling, otherwise that thread will
hang when the app tries to stop until some event happens.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
/external/libusb/libusb/hotplug.c
f50592979811a00d52305ea02b420cb9cacc99b4 04-Jul-2013 Hans de Goede <hdegoede@redhat.com> hotplug: Give the usbi_hotplug_match* functions a context parameter

So that the device parameter can be NULL, in combination with a 0
events parameter, to be used to force lazy deregistration.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
/external/libusb/libusb/hotplug.c
b4c18fac65a594502eec5edd2611d5953e7950f7 03-Jul-2013 Pete Batard <pete@akeo.ie> Doc: update hotplug, topology and descriptor documentation

* Also fix some typos
* Closes #95
/external/libusb/libusb/hotplug.c
3abc6f3ba50bd6fd82b839f698ca2c7fa34ea066 24-May-2013 Toby Gray <toby.gray@realvnc.com> Hotplug: Make use of HAVE_SYS_TYPES_H define

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
/external/libusb/libusb/hotplug.c
86031e26ad8c1516ded02a06834312951a7a0492 15-May-2013 Hans de Goede <hdegoede@redhat.com> Bump LIBUSBX_API_VERSION for new hotplug API

And document the minimum version under which hotplug is supported

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
/external/libusb/libusb/hotplug.c
7801ff94fa6e49fe98433eccc7f2e461590a6f7c 29-Nov-2012 Nathan Hjelm <hjelmn@me.com> Add hotplug support.

The internal API is changing as follows:
- Adding two new functions. usbi_connect_device, and usbi_disconnect_device.
Backends must call these functions to add them to the context's device list
at one of two places: initial enumeration (done at init), and on device
attach and removal. These functions need to be called once per context.
- Backends that support hotplug should not provide a get_device_list funtion.
This function is now deprecated and will likely be removed once all backends
support hotplug.

The external API is changing as follows:
- Two new functions have been added to register and deregister callbacks for
hotplug notification: libusb_hotplug_register_callback(),
libusb_hotplug_deregister_callback(). Hotplug callbacks are called by
libusb_handle_events(). Details of the new API can be found in libusb.h.
- A new capability check has been added to check for hotplug support. See
LIBUSB_CAP_HAS_HOTPLUG.

Aa suggested by Xiaofan add new example has been added to show how to use
the new external hotplug API. See examples/hotplugtest.c.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
/external/libusb/libusb/hotplug.c