| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
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().
|
| |
|
|
|
|
|
|
|
|
| |
Document behaviour where host-endian and bus-endian (little) should be
used respectively.
Also remove packed attribute from libusb_control_setup as all fields
are naturally aligned.
|
| |
|
| |
|
| |
|
|
|
|
| |
Otherwise there is no way to know which values to look for.
|
|
|
|
| |
Be more flexible when certain parts of sysfs are not available.
|
|
|
|
| |
This can be computed from bus number and device address
|
|
|
|
|
|
| |
libusb no longer caches descriptors in libusb_device but backends are
intended to be able to provide copies from memory. In the common linux
case we can use sysfs.
|
| |
|
|
|
|
|
| |
The ioctl expects an integer.
Bug found with the assistance of Soumen Mondal
|
|
|
|
| |
Partially based on some libusb-devel discussions
|
|
|
|
|
|
| |
Suggested by Alan Stern. This avoids waking up any suspended USB devices.
sysfs is not available on all systems, so the usbfs mechanism is still
in place as a fallback.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
OS modules now provide functionality for fetching device/config
descriptors
|