| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
It's here!
|
|
|
|
| |
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.ent>
|
|
|
|
|
| |
Shannon Chuang pointed out that we only read 1 byte into an
uninitialized integer, and then return the whole thing.
|
|
|
|
| |
Pointed out by Shannon Chuang.
|
|
|
|
|
|
| |
Documentation brushed up, and I realised that another function is
needed for tight event handling loops -- they must be able to check
if an open/close operation is trying to interrupt it.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ludovic Rousseau found that crashes often occur if you close a device
while another thread is doing event handling.
Fix this by adding an internal control pipe, which the close routines
use to interrupt the event handler and obtain the event handling lock,
ensuring that no other thread is handling events while the device is
closed. After the close completes, it signals all the event handlers
to start up again using the usual mechanism.
Also modified libusb_open() to do a similar thing, so that event
handlers are interrupted in order to realise that a new poll fd has
appeared.
|
|
|
|
|
|
| |
Add support for re-attaching a driver to a device under Linux.
[dsd: fixed handling of return value, and added LIBUSB_ERROR_BUSY case]
|
|
|
|
| |
Handle more URB error status codes, thanks to Lou and Alan Stern.
|
|
|
|
|
|
|
| |
Contrary to libusb 0.1, libusb 1.0 does not support out-of-tree building
for the documentation part. This patch fixes that by using a
doxygen.cfg.in file, which contains @top_srcdir@ to refer to the
location of the libusb source code.
|
|
|
|
| |
Suggested by Lou.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This fixes a problem pointed out by Lou, where resubmitting a transfer
that previously timed out never timed out again, as if the timeout had
been set to 0.
|
|
|
|
| |
Pointed out by Lou
|
| |
|
|
|
|
|
| |
The length of the directory name varies, e.g. when you have nested hubs.
Use dynamic allocation to be able to deal with any length of name.
|
|
|
|
|
| |
Thanks to clarification from Artem Egorkine, MAX_PATH already includes
space for the trailing NULL.
|
|
|
|
|
|
| |
Reset counters to 0 so that it's possible to cancel a transfer twice
without breaking things. Not sure that I want to support this properly,
but this makes it work at least.
|
| |
|
| |
|
|
|
|
|
| |
As of 2.6.26, the descriptors file now includes all descriptors, not
just the active one.
|
| |
|
|
|
|
|
| |
Suggested by David Zeuthen. This allows multiple libraries in the same
process to independently use libusb without interfering.
|
|
|
|
|
|
| |
This reverts commit 2d3a1111caff40ebb87983c861ff548cdc9e5946.
This was based on the assumption that dying threads would automatically
release mutexes, which is not the case.
|
| |
|
|
|
|
|
|
| |
We cannot dereference tpriv after calling
usbi_handle_transfer_cancellation() because that function may invoke
the user-supplied callback which may free the transfer.
|
|
|
|
|
|
| |
At Alan Stern's suggestion, just offer the bare "set configuration" and
"get configuration" functionality, and let applications worry about the
specific race conditions and unusual situations.
|
|
|
|
| |
Add a THANKS file, make copyright notices easily accessible, update TODO
|
|
|
|
|
| |
Pointed out by Richard Röjfors, otherwise we end up busy-looping with
a poll() timeout of 0.
|
|
|
|
|
|
|
| |
libusb_open() returns int instead of libusb_device_handle.
Signed-off-by: Felipe Balbi <me@felipebalbi.com>
[dsd: small correction]
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ludovic Rousseau pointed out that libusb_unlock_events() is not called
when a thread gets terminated with a signal, meaning that event waiters
will not be woken up in this case.
Add a temporary hack to libusb_event_handler_active() so that at least
the other threads will realise on the next iteration of their event
handling loop.
The real fix will likely involve reworking most of this.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Applications will generally want to set a configuration before claiming
interfaces. The problem is that the interface may already be set, and
someone else may have claimed an interface (meaning that all calls to
set_configuration will fail, even if it's for the same configuration).
There are now 2 options:
1. Use the new libusb_get_configuration() to determine active
configuration before calling libusb_set_configuration()
2. Or just call libusb_set_configuration() as usual, which will do
nothing if that configuration is already active.
|
|
|
|
| |
First libusb-1.0 beta release
|
|
|
|
|
| |
This avoids a race between the user checking for active event handler
and then blocking on the condition variable
|
|
|
|
|
|
| |
Now offers a mechanism to wait for events while another thread is
doing the event handling. Complicates things for MT async apps, but
then again it's a bit of a tricky combination to start with.
|
|
|
|
| |
Based on ideas from Ludovic Rousseau
|
|
|
|
|
|
|
| |
Add libusb_set_debug() API to set message verbosity.
Ludovic Rousseau pointed out that applications may close stdout/stderr
descriptors, which might then be reused.
|
|
|
|
| |
Pointed out by David Engraf: we weren't freeing the transfer buffer
|
|
|
|
|
|
| |
The return value of some ioctl commands in linux_usbfs.c are not
handeled correct. The ioctl function returns != 0 and errno is set with
the error code.
|
|
|
|
|
|
|
| |
This patch closes a critical memory leak in handle_events. The fds
variable is malloced but never freed. When I'm calling
handle_events with a timeout of 0, my system runs out of memory after a
few seconds.
|
|
|
|
| |
Hopefully one of the last API tweaks...
|
|
|
|
|
| |
Alan Stern pointed out that usbfs gives host-endian data, but sysfs gives
bus-endian.
|
|
|
|
| |
Hopefully comprehensive enough for people to get started.
|
|
|
|
| |
Reported and tested by Xiaofan Chen
|
|
|
|
|
|
|
| |
We were forgetting about the remaining urbs when a non-final urb
completed early.
[dsd: some touchups and a warning message for a corner case that we don't handle]
|
|
|
|
|
| |
This involved moving from select() to poll() because there is no way to
distinguish usbfs's POLLERR condition with select().
|
| |
|