Hyotaek Shim [Fri, 8 Sep 2017 08:25:05 +0000 (17:25 +0900)]
Add a LICENSE.MIT file and it to the build spec.
Change-Id: I6777ddcb521f98b1130ae64d89db0f73f03bdcc7
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
(cherry picked from commit
4ae9aa7a8aa203e1e86f3b09320ff695dcca8f0a)
lokilee73 [Thu, 20 Jul 2017 07:18:39 +0000 (16:18 +0900)]
usbhost : add 99-usbhost.rules file to control usb node
Change-Id: I2df224d35e058d0580233a03892d05b67ea04631
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
INSUN PYO [Fri, 23 Jun 2017 08:45:04 +0000 (17:45 +0900)]
dbus: add missing dbus_connection_unref() for shared connection
Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: I50c418861daa72fe77339897530df745897068ee
Krzysztof Opasiak [Thu, 13 Apr 2017 11:23:27 +0000 (13:23 +0200)]
Bump version to v.1.0.21
1) Switch from pristine-tar model to new one (upstream + tizen branch)
2) Drop commits:
59f513e91878a8b87a8462b1cf49b46d55f959ce ("Do not search for usbfs path")
a9d76751ed87ae59949aa050a6268a2def70d208 ("usbhost api: do not search the usbfs path for Mobile profile")
as there is a suitable fix in mainline
3) Upgrade libusb to v1.0.21
Change-Id: I42ec75e9d3b95c4cbf978125b5d945cf0896b27e
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
taeyoung [Thu, 23 Feb 2017 04:52:12 +0000 (13:52 +0900)]
usbhost api: remove profile dependency
- Only Mobile profile supported usb host api until Tizen 3.0
- To remove the profile dependency, usb host api related codes
are enabled.
= If usb host api is used, all things are same with Tizen 3.0
= If libusb is used directly,
1) root users can access to usb device like Tizen 3.0
2) normal users cannot open usb device, and thus
dbus requests to deviced will be triggered.
If deviced supports usb host api, usb permission popup
will be launched for the confirmation from user.
If deviced does not support usb host api, the requests
are rejected.
Change-Id: Id72a27d5aa78ebaf8006a649c20d88d2c0e6ca65
Signed-off-by: taeyoung <ty317.kim@samsung.com>
Paweł Szewczyk [Wed, 21 Sep 2016 12:50:36 +0000 (14:50 +0200)]
usbhost api: fix dbus method call to deviced
Change-Id: If17b9f30e2301bea9558e2899f740e952b1455b1
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
taeyoung [Wed, 21 Sep 2016 07:54:54 +0000 (16:54 +0900)]
usbhost api: replace libdeviced to dbus method
libusb cannot use libdeviced since circular dependency problem exists.
libusb -> bluez -> pulseaudio (libpulse) -> efl (ecore) -> deviced -> libusb
Thus libdeviced is replaced to the dbus method which is provided by deviced.
Change-Id: Ia1ee8b72c17f30c8b4c49526d0101ed9294f230f
Signed-off-by: taeyoung <ty317.kim@samsung.com>
[Rebase onto new library version]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
taeyoung [Tue, 13 Sep 2016 04:02:56 +0000 (13:02 +0900)]
usbhost api: enable deviced feature just for mobile profile
usb host api is Mobile profile feature currently. Thus
deviced related codes should be applied to mobile profile only.
Change-Id: I354c784b32ed37a5834f8adbb5a561e75fa0eb99
Signed-off-by: taeyoung <ty317.kim@samsung.com>
taeyoung [Fri, 12 Aug 2016 04:22:59 +0000 (13:22 +0900)]
usbhost api: disable Tizen usb host apicodes on TV profile
- TV profile does not support Tizen usbhost api.
Thus the codes related with it are removed on TV profile.
Change-Id: Id38ea19827b73ee345cbff43cfc0a4cc347773a1
Signed-off-by: taeyoung <ty317.kim@samsung.com>
Paweł Szewczyk [Thu, 11 Feb 2016 13:01:09 +0000 (14:01 +0100)]
Use deviced instead of USB Security Daemon
Change-Id: I507208ee6d4ba2549ce59a1d70ee224f6ee73fc3
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
[Rebase onto new library version]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Krzysztof Opasiak [Mon, 29 Jun 2015 10:31:05 +0000 (12:31 +0200)]
Allow to obtain fd from USB Security Daemon
Tizen don't allow applications to directly open device
nodes for communication with USB devices. We have our own
daemon (USD - USB Security Daemon) which holds the policy
of accessing USB devices. Each app which would like to
communicate with device has to ask USD to open suitable file
and pass fds to app.
This patch updates libusb and first tries to open device
node directly and only if it fails asks USD to open fds.
This allows to not influence existing libusb users which
has root rights and check USD permissions only for external
applications.
Change-Id: I9dcac37ccc8ae86cef4d22965744781307940e61
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Rebase patch onto new library version]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Łukasz Stelmach [Tue, 16 Jun 2015 11:22:59 +0000 (13:22 +0200)]
Upgrade libusb to version 1.0.19
Change-Id: I39653675c3e57d61ca35f0aafdf14552385e20bf
Alexandru Cornea [Mon, 1 Jul 2013 16:46:11 +0000 (19:46 +0300)]
resetting manifest requested domain to floor
Change-Id: Ia8bdd7cfc7f730dabf58a1fa3abf68cd0fb73bdf
Anas Nashif [Mon, 18 Mar 2013 20:44:33 +0000 (13:44 -0700)]
Update package groups
Change-Id: I7f0cadec585a535be7b6a1c87e6df3f1e6dc8b16
Anas Nashif [Sun, 4 Nov 2012 15:23:38 +0000 (07:23 -0800)]
fixed packaging
Change-Id: Ib4c1433c546a180b9145596c3b986123f60a56bd
Anas Nashif [Sun, 4 Nov 2012 15:22:54 +0000 (07:22 -0800)]
add packaging
Change-Id: Id2574eb30eac53c193795d2a1a1798847835cc50
Nathan Hjelm [Tue, 25 Oct 2016 16:07:38 +0000 (10:07 -0600)]
Release 1.0.21
Closes #93
Signed-off-by: Nathan Hjelm <hjelmn@mac.com>
Nathan Hjelm [Tue, 25 Oct 2016 16:05:20 +0000 (10:05 -0600)]
Remove generated file
Signed-off-by: Nathan Hjelm <hjelmn@mac.com>
Nathan Hjelm [Sat, 1 Oct 2016 14:12:19 +0000 (08:12 -0600)]
fix travis matrix build
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Sat, 1 Oct 2016 13:42:30 +0000 (07:42 -0600)]
try to get travis building with multiple macOS versions
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Sat, 1 Oct 2016 13:20:40 +0000 (07:20 -0600)]
travis osx fix
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Chris Dickens [Wed, 14 Sep 2016 05:09:50 +0000 (22:09 -0700)]
Windows: Fix possible false error message during device enumeration
During early phases of enumeration, it is possible for a device to be
enumerated before its parent. When this occurs, the device assigned as
the parent will actually be a grandparent. During later phases of
enumeration, the parent device will in fact exist but will not match
what has already been assigned to the device.
This commit adds code to check for and update the parent device when
this situation occurs.
Closes #206
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Nathan Hjelm [Sat, 1 Oct 2016 12:49:09 +0000 (06:49 -0600)]
on to 1.0.21-rc6
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Wed, 21 Sep 2016 15:01:38 +0000 (09:01 -0600)]
darwin: fix OSAtomicAdd32Barrier argument ordering
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Wed, 14 Sep 2016 18:32:54 +0000 (12:32 -0600)]
on to 1.0.21-rc5
Signed-off-by: Nathan Hjelm <hjelmn@me.gov>
Sean McBride [Wed, 14 Sep 2016 16:50:09 +0000 (12:50 -0400)]
Fixed Obj-C GC support; fix pthread name
Fixed some recent regressions:
- Always call pthread_setname_np. Recent change removed this if > 10.8.
- Always call objc_registerThreadWithCollector(), except if deploying to 10.12 or later, which GC is removed anyway.
NTH: Note, the header in macOS 10.12 documents that the auto-release
feature was removed and "does nothing" since 10.8. The source code
available from 10.8-10.11 clearly shows that the
objc_registerThreadWithCollector call does something so we will leave
it enabled for this version range. More details are needed from Apple
to interpret the meaning of the deprecation message in 10.12.
Closes #210
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Tue, 13 Sep 2016 04:04:22 +0000 (22:04 -0600)]
README: fix my email address
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Tue, 13 Sep 2016 04:00:04 +0000 (22:00 -0600)]
darwin: fix typo
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Tue, 13 Sep 2016 03:42:23 +0000 (21:42 -0600)]
on to 1.0.21-rc4
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Tue, 13 Sep 2016 03:38:44 +0000 (21:38 -0600)]
darwin: do not use deprecated OSAtomicIncrement32Barrier in 10.12
This commit fixes a warning introduced by macOS 10.12 Sierra when
using the OS atomics. These atomics have been deprecated in favor
of the ones provided by C11 (stdatomic.h). On older versions of
OS X we still use the OS atomics (now OSAtomicAdd32Barrier) and
on 10.12.0 and newer we use atomic_fetch_add.
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Thu, 8 Sep 2016 00:50:43 +0000 (18:50 -0600)]
darwin: do not use objc_registerThreadWithCollector where deprecated
This commit updates the check around objc_registerThreadWithCollector
to enable the call only between 10.6 (introduced) and 10.8 (deprecated).
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Thu, 8 Sep 2016 00:47:25 +0000 (18:47 -0600)]
darwin: work around devices with buggy endpoint descriptors
This commit adds a workaround for devices that have buggy endpoint
descriptors but are otherwise functional. These devices will have
endpoints that fail the GetPipeProperties call. Since we only care
about the endpoint address we can read it from the descriptor
itself.
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Mon, 22 Aug 2016 02:32:39 +0000 (20:32 -0600)]
release: on to 1.0.21-rc3
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Hans de Goede [Thu, 11 Aug 2016 09:12:56 +0000 (11:12 +0200)]
core: Document why we drop the flying_transfers_lock before submit_transfer
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Tue, 7 Jun 2016 10:12:38 +0000 (12:12 +0200)]
linux_usbfs: Deal with receiving POLLERR before all transfers have completed
The linux kernel will set its internal device state to USB_STATE_NOTATTACHED
as soon as it detects the disconnect, and then start a worker thread to
deal with the actual disconnection, kill outstanding urbs, etc.
The usbfs poll implementation will return POLL_ERR as soon as
ps->dev->state == USB_STATE_NOTATTACHED. The kernel will not wakeup
the poll until it is done with processing the disconnection. But if
we happen to call poll() between the state change and the disconnection
being fully processed, we may not be able to reap all outstanding transfers,
even on kernels with the USBFS_CAP_REAP_AFTER_DISCONNECT capability.
This commit deals with this by trying to reap as many transfers as possible
on disconnect on USBFS_CAP_REAP_AFTER_DISCONNECT capable kernels and then
calling usbi_handle_disconnect(handle) to deal with any remaining ones.
On USBFS_CAP_REAP_AFTER_DISCONNECT capable kernels this will be a no-op
unless we hit the race.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Wed, 8 Jun 2016 08:34:05 +0000 (10:34 +0200)]
core: Move calculate_timeout call to add_to_flying_transfers
This cleans-up libusb_submit_transfer a bit by avoiding an error
exit path with unlock calls.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Mon, 6 Jun 2016 15:43:23 +0000 (17:43 +0200)]
core: Fix unlocked access to timeout_flags
There is a race between handle_timeout() and the completion functions.
When one thread is in handle_timeout() and another thread wakes
up from a poll(), there exists a window where the transfer has been
cancelled, but USBI_TRANSFER_TIMED_OUT is not yet set in timeout_flags.
Therefore, usbi_handle_transfer_completion() is sometimes called
with LIBUSB_TRANSFER_CANCELLED instead of the expected
LIBUSB_TRANSFER_TIMED_OUT.
timeout_flags is protected by the flying_transfers_lock, this commit
makes usbi_handle_transfer_cancellation() take that lock before
checking for USBI_TRANSFER_TIMED_OUT in timeout_flags, fixing this.
Reported-by: Joost Muller <joostmuller@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Mon, 6 Jun 2016 15:42:12 +0000 (17:42 +0200)]
core: Fix do_close locking
Put the lock / unlock calls around the part of the code which actually
checks the flags which the lock protect.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Mon, 6 Jun 2016 14:54:42 +0000 (16:54 +0200)]
core: Test for LIBUSB_SUCCESS instead of 0 in handle_timeout()
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Mon, 6 Jun 2016 14:53:53 +0000 (16:53 +0200)]
core: Do not arm timer-fd for transfers where the os handles timeout
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Chris Dickens [Mon, 26 Oct 2015 13:18:33 +0000 (14:18 +0100)]
core: Refactor code related to transfer flags and timeout handling
Commit
a886bb02 sped up the library a bit by removing the serialization
of transfer submission with respect to the flying_transfers list, but
it introduced two separate issues.
1) A deadlock scenario is possible given the following sequence:
- Thread A submits transfer with very short timeout (say 1ms)
-> takes transfer->lock
-> adds transfer to flying_transfers list and arms timerfd
-> actually calls backend to submit transfer, but it fails
<context switch>
- Thread B is doing event handling and sees the timerfd trigger
-> takes ctx->flying_transfers_lock
-> finds the transfer above on the list
-> calls libusb_cancel_transfer() for this transfer
--> takes transfer->lock
<context switch>
- Thread A sees the transfer failed to submit
-> removes transfer from flying_transfers list
--> takes ctx->flying_transfers_lock (still holding transfer->lock)
** DEADLOCK **
2) The transfer state flags (e.g. submitting, in-flight) were protected
by transfer->flags_lock, but the timeout-related flags were OR'ed in
during timeout handling operations outside of the lock. This leads to
the possibility that transfer state might get overwritten.
This change corrects these issues and simplifies the transfer submission
code a bit by separating the state and timeout flags into their own flag
variables. The state flags are protected by the transfer lock. The timeout
flags are protected by the flying_transfers_lock.
The transfer submission code sheds some weight because it no longer needs
to worry about the timing of events that modify the transfer state flags.
These flags are always viewed and modified under the protection of the
transfer lock. Since libusb_submit_transfer() holds the transfer lock for
the entire duration of the operation, the other code paths that would
possibly touch the transfer (e.g. usbi_handle_disconnect() and
usbi_handle_transfer_completion()) have to wait for transfer submission
to fully complete. This eliminates any possible race conditions.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
[hdegoede@redhat.com: Reworked libusb_submit_transfer changes so that in
case both flying_transfer_lock and itransfer->lock are taken
flying_transfers_lock is always taken first]
[hdegoede@redhat.com: Removed some unrelated changes (will be submitted
as separate patches)]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Mon, 6 Jun 2016 14:43:18 +0000 (16:43 +0200)]
winnt: Do not differ between cancel / timeout ourselves
(itransfer->flags & USBI_TRANSFER_TIMED_OUT) is already checked by
usbi_handle_transfer_cancellation(), make windows_transfer_callback()
call usbi_handle_transfer_cancellation() when
status == LIBUSB_TRANSFER_CANCELLED like all other os backends do, and
leave USBI_TRANSFER_TIMED_OUT handling up to the core, so that future
changes to timeout handling do no break winnt.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Note: untested
Hans de Goede [Mon, 6 Jun 2016 14:40:54 +0000 (16:40 +0200)]
wince: Do not differ between cancel / timeout ourselves
(itransfer->flags & USBI_TRANSFER_TIMED_OUT) is already checked by
usbi_handle_transfer_cancellation(), which wince_transfer_callback()
will call when status == LIBUSB_TRANSFER_CANCELLED. Leave this up
to the core, so that future changes to timeout handling do no break
wince.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Note: untested
Chris Dickens [Mon, 26 Oct 2015 13:11:53 +0000 (14:11 +0100)]
core: Change event handling lock to traditional (non-recursive) type
The event handling lock was previously required to be of the recursive
type because the libusb_close() path requires the lock and may be
called by a thread that is handling events (e.g. from within a
transfer or hotplug callback). With commit
960a6e75, it is possible to
determine whether the current function is being called from an event
handling context, thus the recursive lock type is no longer necessary.
References:
* http://libusb.org/ticket/82
*
74282582cc879f091ad1d847411337bc3fa78a2b
*
c775c2f43037cd235b65410583179195e25f9c4a
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
[hdegoede@redhat.com: rebase on top of current master]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Wed, 10 Aug 2016 10:17:00 +0000 (12:17 +0200)]
Revert "io: Fix race condition in handle_timeout()"
This reverts commit
bd8d5b5019b72b2dc2d074d96c9992e2f6e7e0b7.
Chris Dickens and me have been working on a patch-set refactoring
the transfer flag handling which fixes this differently. Revert
this commit so that the refactoring changes can be merged cleanly.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Nathan Hjelm [Mon, 25 Jul 2016 02:04:34 +0000 (20:04 -0600)]
on to 1.0.21-rc2
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Anil Nair [Sun, 24 Jul 2016 15:42:26 +0000 (21:12 +0530)]
Updated TODO link
Closes #198
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Mon, 25 Jul 2016 02:01:15 +0000 (20:01 -0600)]
changelog: add entry for new solaris backend
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Lei Chen [Fri, 19 Feb 2016 03:58:39 +0000 (11:58 +0800)]
Solaris backend
Closes #177
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Fri, 22 Jul 2016 12:38:09 +0000 (06:38 -0600)]
changelog: add missing entry
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Pete Batard [Fri, 22 Jul 2016 11:57:40 +0000 (12:57 +0100)]
windows: use appropriate version for VS2015 solution files
* Closes #193
Nathan Hjelm [Fri, 22 Jul 2016 05:12:56 +0000 (23:12 -0600)]
libusb 1.0.21-rc1
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Joost Muller [Wed, 20 Jul 2016 08:58:57 +0000 (10:58 +0200)]
io: Fix race condition in handle_timeout()
There is a race between handle_timeout() the completion functions.
When one thread is in handle_timeout() and another thread wakes
up from a poll(), there exists a window where the transfer has been
cancelled, but its USBI_TRANSFER_TIMED_OUT flag is not set yet.
Therefore, usbi_handle_transfer_completion() is sometimes called
with LIBUSB_TRANSFER_CANCELLED instead of the expected
LIBUSB_TRANSFER_TIMED_OUT.
This change adds transfer and flag locks to the handle_timeout()
function.
Closes #197
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Fri, 22 Jul 2016 04:38:32 +0000 (22:38 -0600)]
examples: add missing include to dpfp_threaded
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Fri, 22 Jul 2016 04:31:09 +0000 (22:31 -0600)]
fix nano
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Fri, 22 Jul 2016 04:26:19 +0000 (22:26 -0600)]
examples: make dpfp_threaded work on OS X
OS X does not support unnamed semaphores so the example has been
updated to use a named semaphore instead.
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Anil Nair [Sat, 2 Apr 2016 00:59:11 +0000 (06:29 +0530)]
Examples: Ported testlibusb from libus-0.1 to libusb-1.0
This commit is based on Nathan's branch
https://github.com/hjelmn/libusb-darwin/blob/master/examples/testlibusb1.c
Closes #178
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Jeffrey Nichols [Mon, 21 Mar 2016 17:53:11 +0000 (13:53 -0400)]
Add support for Intel Alpine Ridge USB 3.1 Controller on Windows 7.
Closes #176
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Chris Dickens [Mon, 30 May 2016 02:44:29 +0000 (19:44 -0700)]
Windows: Clean up referenced devices when memory allocation fails
Similar to commit
adb6e39b68699b5d849836f9aaff7640b0f16173, drop the
use of usbi_reallocf() as the memory would be freed, thereby leaking
device references.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
FTDI Dev [Wed, 2 Mar 2016 16:29:27 +0000 (16:29 +0000)]
Clean failure in discovered_devs_append.
Closes #161
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Chris Dickens [Mon, 30 May 2016 02:51:48 +0000 (19:51 -0700)]
Misc: Fix usbi_os_backend structure initialization
Backends not using named initializers were broken by the recent
addition of commit
a283c3b5a3dce8f6f33331b9aa1d95d41c8f241c.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Chris Dickens [Mon, 30 May 2016 02:19:51 +0000 (19:19 -0700)]
Misc: Add .amend to .gitignore
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Steinar H. Gunderson [Sat, 20 Feb 2016 11:26:12 +0000 (12:26 +0100)]
Add support for persistent device memory.
Add a function to allocate memory belonging to a specific device,
so that the operating system can DMA straight into it for zerocopy,
and also avoid some clearing. Also, this allows up-front memory
allocation in the kernel at program startup; memory allocation is
otherwise done per-transfer, which can fail in a system where memory has become
fragmented over time).
This mirrors new functionality going into Linux' USB stack (recently
reviewed and acked upstream); only Linux is supported as a backend
currently.
[Chris Dickens] Modified to fix doxygen documentation, correct parameter
naming, reposition function declarations, and address a missing request
during the patch review process.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Chris Dickens [Mon, 30 May 2016 00:35:09 +0000 (17:35 -0700)]
Windows: Fix false assertion failure message during enumeration
Commit
1d54ee1b6687c532eca75925f56eb12e2a34ce42 addressed a device
reference leak but introduced a false warning message that occurs
for devices detected in early enumeration passes (e.g. hubs). The
assertion is meant to warn of a mismatch between parent devices but
fails to account for the fact that some devices that are allocated
early do not have a parent device assigned until the later
enumeration passes.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Nathan Hjelm [Sun, 20 Mar 2016 15:48:06 +0000 (09:48 -0600)]
AUTHORS: update my copyright
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
hacker2490 [Thu, 3 Mar 2016 11:31:37 +0000 (17:01 +0530)]
AppVeyor: add cygwin and minGW support
- Changes in platform configuration, x86 breaks the build
- Solution file does not contain platform for Any CPU, fixing it to Win32
- Added Multiple solutions to appveyor configuration file
- Added batch script for VS2010 builds
- Added fixes to appveyor.bat file and appveyor.yml
- Fixes for Platform and Configuration in appveyor.bat
- Fixed windows exit code, Appveyor reports exit on succesful build
- Multiple Builds in same platform and configuration, fixed it
- Added appveyor configuration to compile using MinGW 32-bit and 64-bits
- Minor Fixes for batch file and Added cygwin build script
Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
Nathan Hjelm [Sat, 12 Mar 2016 14:31:45 +0000 (07:31 -0700)]
fix nano version
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Sat, 12 Mar 2016 14:29:55 +0000 (07:29 -0700)]
autogen: remove --enable-maintainer-mode
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Thu, 10 Mar 2016 19:57:50 +0000 (12:57 -0700)]
configure: bump autoconf version and remove obsolete AM_MAINTAINER_MODE
This commit bumps the minimum autoconf version to 2.69. This only
affects maintainers and will ensure libusb tarballs have up-to-date
configure scripts. At the same time we are removing the
AM_MAINTAINER_MODE macro as even its creator recommends against
using it.
Closes #122
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Sun, 6 Mar 2016 22:04:02 +0000 (15:04 -0700)]
core: re-add one more conditional
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Sun, 6 Mar 2016 22:00:31 +0000 (15:00 -0700)]
core: revert some of prior patch
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Ludovic Rousseau [Sun, 6 Mar 2016 21:51:46 +0000 (22:51 +0100)]
README.md: update AppVeyor badge (again)
Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
Gaurav [Fri, 19 Jun 2015 03:23:59 +0000 (08:53 +0530)]
free can handle NULL ptr.
free(NULL) is no operation.
Contributed by @ya1gaurav.
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
hacker2490 [Thu, 3 Mar 2016 11:31:37 +0000 (17:01 +0530)]
AppVeyor: use a .bat file now
- Changes in platform configuration, x86 breaks the build
- Solution file does not contain platform for Any CPU,fixing it to Win32
- Added Multiple solutions to appveyor configuration file
- Added batch script for VS2010 builds
- Added fixes to appveyor.bat file and appveyor.yml
- Fixes for Platform and Configuration in appveyor.bat
- Fixed windows exit code, Appveyor reports exit on succesful build
- Multiple Builds in same platform and configuration,fixed it
William Skellenger [Sun, 3 Jan 2016 22:04:54 +0000 (17:04 -0500)]
android: update README
Added other $ARCH
Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
William Skellenger [Mon, 4 Jan 2016 02:46:50 +0000 (21:46 -0500)]
android: Fix typo in README
Remove the /sdcard copy and not the /system/lib copy
Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
Ludovic Rousseau [Sun, 6 Mar 2016 20:37:00 +0000 (21:37 +0100)]
README.md: update AppVeyor badge
Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
Ludovic Rousseau [Sun, 6 Mar 2016 12:42:13 +0000 (13:42 +0100)]
examples: fix 3 compiler warnings
examples/hotplugtest.c:76:28: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
vendor_id = (argc > 1) ? strtol (argv[1], NULL, 0) : 0x045a;
~ ^~~~~~~~~~~~~~~~~~~~~~~~~
examples/hotplugtest.c:77:28: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
product_id = (argc > 2) ? strtol (argv[2], NULL, 0) : 0x5005;
~ ^~~~~~~~~~~~~~~~~~~~~~~~~
examples/hotplugtest.c:78:28: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
class_id = (argc > 3) ? strtol (argv[3], NULL, 0) : LIBUSB_HOTPLUG_MATCH_ANY;
~ ^~~~~~~~~~~~~~~~~~~~~~~~~
Ludovic Rousseau [Sun, 6 Mar 2016 12:37:14 +0000 (13:37 +0100)]
darwin: build hotplugtest sample in Xcode
The Xcode project now also builds the hotplugtest (from examples/hotplugtest.c)
target.
parafin [Thu, 15 Oct 2015 17:12:42 +0000 (20:12 +0300)]
darwin: fix occasional dead-lock on libusb_exit
CFRunLoopStop() isn't thread-safe, see for example this bugreport:
https://github.com/joyent/libuv/issues/799
Use CFRunLoopSource instead
Closes #112
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Sat, 5 Mar 2016 15:00:11 +0000 (08:00 -0700)]
xusb: fix typo
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Stefan Tauner [Mon, 18 Jan 2016 23:02:16 +0000 (00:02 +0100)]
Replace obsolete usleep with nanosleep
This fixes compiling libusb with uclibc.
Closes #141, #165
Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at>
Ludovic Rousseau [Thu, 3 Mar 2016 20:50:15 +0000 (21:50 +0100)]
README.md: add AppVeyor badge
Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
hacker2490 [Thu, 3 Mar 2016 20:11:20 +0000 (21:11 +0100)]
AppVeyor: initial configuration file
Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
Chris Dickens [Thu, 3 Mar 2016 08:20:33 +0000 (00:20 -0800)]
Windows: Fix MinGW build
The integration of UsbDk moved the windows_error_str() function to
windows_nt_common.c, but the definition of FACILITY_SETUPAPI (which
MinGW headers do not provide) did not follow the move.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Ludovic Rousseau [Sat, 27 Feb 2016 16:17:24 +0000 (17:17 +0100)]
travis-CI: fails compilation on warning
The travis-autogen.sh script enable some extra warnings not used by
default. The idea is to detect problem as early as possible.
Ludovic Rousseau [Sat, 27 Feb 2016 16:52:05 +0000 (17:52 +0100)]
examples: fix 3 compiler warnings
fxload.c:202:17: warning: comparison of integers of different signs: 'int' and
'unsigned long' [-Wsign-compare]
...for (j=0; j<ARRAYSIZE(known_device); j++) {
~^~~~~~~~~~~~~~~~~~~~~~~~
fxload.c:222:12: warning: comparison of integers of different signs: 'int' and
'unsigned long' [-Wsign-compare]
if (j < ARRAYSIZE(known_device)) {
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~
fxload.c:263:13: warning: comparison of integers of different signs: 'int' and
'unsigned long' [-Wsign-compare]
for (i=0; i<ARRAYSIZE(path); i++) {
~^~~~~~~~~~~~~~~~
Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
Ludovic Rousseau [Sat, 27 Feb 2016 16:49:55 +0000 (17:49 +0100)]
examples: fix 2 compiler warnings
sam3u_benchmark.c:54:17: warning: comparison of integers of different signs:
'unsigned int' and 'int' [-Wsign-compare]
for (i = 0; i < xfr->num_iso_packets; i++) {
~ ^ ~~~~~~~~~~~~~~~~~~~~
sam3u_benchmark.c:67:16: warning: comparison of integers of different signs:
'unsigned int' and 'int' [-Wsign-compare]
for (i = 0; i < xfr->actual_length; i++) {
~ ^ ~~~~~~~~~~~~~~~~~~
Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
Ludovic Rousseau [Sat, 27 Feb 2016 16:47:12 +0000 (17:47 +0100)]
examples: fix 2 compiler warnings
ezusb.c:136:13: warning: comparison of integers of different signs: 'int' and
'size_t' (aka 'unsigned long') [-Wsign-compare]
if (status != len) {
~~~~~~ ^ ~~~
ezusb.c:159:13: warning: comparison of integers of different signs: 'int' and
'size_t' (aka 'unsigned long') [-Wsign-compare]
if (status != len) {
~~~~~~ ^ ~~~
Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
Ludovic Rousseau [Sat, 27 Feb 2016 16:42:55 +0000 (17:42 +0100)]
darwin: fix 1 compiler warning
os/darwin_usb.c:248:18: warning: comparison of integers of different signs:
'CFIndex' (aka 'long') and 'size_t' (aka 'unsigned long')
[-Wsign-compare]
if (length < size) {
~~~~~~ ^ ~~~~
Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
Ludovic Rousseau [Sat, 27 Feb 2016 16:37:49 +0000 (17:37 +0100)]
core: fix 2 compiler warnings
core.c:2361:35: warning: comparison of integers of different signs: 'int' and
'unsigned long' [-Wsign-compare]
if (header_len < 0 || header_len >= sizeof(buf)) {
~~~~~~~~~~ ^ ~~~~~~~~~~~
core.c:2370:44: warning: comparison of integers of different signs: 'int' and
'unsigned long' [-Wsign-compare]
if (text_len < 0 || text_len + header_len >= sizeof(buf)) {
~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
Ludovic Rousseau [Wed, 2 Mar 2016 13:12:04 +0000 (14:12 +0100)]
README.md: add Coverity badge
The libusb project is available on Coverity at https://scan.coverity.com/projects/libusb-libusb
Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
Chris Dickens [Wed, 2 Mar 2016 08:16:16 +0000 (00:16 -0800)]
Windows: Fix faulty logic that can pick the wrong config descriptor
The WinUSB backend caches the bConfigurationValue of the currently
active configuration when the device is enumerated. In some parts of
the code, the config descriptor is fetched to correlate interfaces
and endpoints by calling libusb_get_config_descriptor() using the
cached bConfigurationValue. This is incorrect usage of the function
as the input parameter is the zero-based configuration index, which
can differ in some devices from the bConfigurationValue.
See discussion: http://marc.info/?l=libusb-devel&m=
144355607228333
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Chris Dickens [Wed, 2 Mar 2016 08:14:50 +0000 (00:14 -0800)]
Windows: Add backend support for get_config_descriptor_by_value()
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Angus Gratton [Tue, 28 Apr 2015 06:49:57 +0000 (16:49 +1000)]
Windows: Fix dev_interface_path memory leak when reusing device ref
windows_get_device_list was leaking dev_interface_path (in either of two
possible places) when a pre-existing device reference was reused.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Angus Gratton [Tue, 28 Apr 2015 06:46:37 +0000 (16:46 +1000)]
Windows: Fix parent USB device reference leak
If windows_get_device_list() found a device that already existed, it
would erronenously increment the parent_dev refcount and cause a
reference leak - the parent device would never be released.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Nathan Hjelm [Thu, 25 Feb 2016 20:35:36 +0000 (13:35 -0700)]
bootstrap: use autoreconf
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Fri, 26 Feb 2016 04:51:10 +0000 (21:51 -0700)]
travis: one more fix. need packages under apt
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Fri, 26 Feb 2016 04:45:15 +0000 (21:45 -0700)]
travis: sources line is needed
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Nathan Hjelm [Fri, 26 Feb 2016 04:40:30 +0000 (21:40 -0700)]
travis: bah. remove tabs
Signed-off-by: Nathan Hjelm <hjelmn@me.com>