summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* threads_posix: use backend clock_gettime()darwin_gettime_fixNathan Hjelm2016-02-252-2/+3
| | | | | | | Some platforms do not implement the optional clock_gettime(). Need to use the backend implementation instead. Signed-off-by: Nathan Hjelm <hjelmn@me.com>
* travis: fix typoNathan Hjelm2016-02-252-2/+2
| | | | Signed-off-by: Nathan Hjelm <hjelmn@me.com>
* travis: ensure udev is installedNathan Hjelm2016-02-252-1/+5
| | | | Signed-off-by: Nathan Hjelm <hjelmn@me.com>
* Add Travis CI configurationNathan Hjelm2016-02-252-1/+15
| | | | Signed-off-by: Nathan Hjelm <hjelmn@me.com>
* core: Remove POSIX threads influence from synchronization codeChris Dickens2016-02-249-96/+79
| | | | | | | | | | | | | | This commit changes the signatures of the synchronization functions to reflect the needs of the library rather than the signature of the pthreads API. The mutex and condition variable attributes parameters have been removed as no part of the core library makes use of them. In addition, the condition variable timed-wait function has been modified to accept the relative time passed in via libusb_wait_for_event(). This allows the implementation-specific code to handle conversion to absolute time as necessary, rather than forcing this to occur. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Misc: Remove unused definitions for usbi_cond_signal()Chris Dickens2016-02-244-22/+1
| | | | Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Misc: Document the return code for control transfers that are too largeChris Dickens2016-02-244-1/+7
| | | | | | Closes #110 Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Misc: Add libusb_interrupt_event_handler() to API docs pageChris Dickens2016-02-242-1/+2
| | | | Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Misc: Prefix doxygen references in order to namespace libusbChris Dickens2016-02-248-210/+210
| | | | | | | | | | | 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>
* Misc: Make API parameter names consistent and sensibleChris Dickens2016-02-247-169/+168
| | | | | | | | | | | 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>
* sync: Allow transferred argument to be optional in bulk APIsChris Dickens2016-02-232-4/+10
| | | | | | Closes #139 Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* windows: Fix compilation for MSYS2Evan Hunter2016-02-232-2/+2
| | | | | | Closes #140 Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* linux_netlink: Add message authentication and clean up parsingChris Dickens2016-02-232-53/+77
| | | | | | | | This commit adds credentials checking to ensure that we only process messages received from the kernel. In addition, the parsing logic was cleaned up and slightly optimized. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* linux_netlink: Add useful debug messages and clean up error handlingChris Dickens2016-02-232-79/+91
| | | | | | Also addresses some minor whitespace and stylistic issues. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* linux_netlink: Remove unnecessary header includes and conditionalsChris Dickens2016-02-233-16/+3
| | | | | | We always require <sys/socket.h> and do not need <linux/filter.h>. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Windows: Fix style issues in threading codeChris Dickens2016-01-303-130/+189
| | | | | | Also moves private structure definition outside of header file. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Windows: Move definitions for Cygwin.KIMURA Masaru2016-01-283-9/+9
| | | | | | Closes #145 Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Windows (winusb): Fix build break introduced in c8f71151 due to typoChris Dickens2016-01-282-2/+2
| | | | Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Misc: Minor stylistic improvements to libusbi.hChris Dickens2016-01-282-53/+58
| | | | Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Windows/WinCE: Improve the run-time dynamic linking schemeChris Dickens2016-01-287-160/+246
| | | | | | | | | | | | | | | Prior to this commit, the Windows and WinCE backends had a specific shortcoming when loading DLLs, that being that once loaded they were never unloaded. This commit improves this by providing a means to unload the DLLs during cleanup. Note that the use of GetModuleHandle() has been removed in favor of the exclusive use of LoadLibrary(). This was done to ensure that a reference count is taken against the loaded DLL, which guards against some other part of the application unloading the DLL that libusb is currently using. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Windows: Fix some minor issues in windows_nt_common.cChris Dickens2016-01-282-9/+9
| | | | | | | 1) Address a few more stylistic discrepancies 2) Add appropriate type casts for printf functions Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* WinCE: Remove unnecessary/unused structureChris Dickens2016-01-283-8/+2
| | | | Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* WinCE: Miscellaneous changesChris Dickens2016-01-282-88/+109
| | | | | | | 1) Make some variables static that are not used outside wince_usb.c 2) Minor stylistic changes to match the rest of the library source Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Windows: Ensure proper cleanup when backend init() functions failChris Dickens2016-01-273-15/+29
| | | | Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Windows: Fix DDK compilationPete Batard2016-01-272-2/+3
|
* Windows: Minor improvements to windows_nt_common.cChris Dickens2016-01-272-4/+6
| | | | | | | | 1) Possible memory leak is avoided if htab_create() is called while a hash table is already allocated 2) Error handling is simplified in windows_handle_events() Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Windows: Replace open-coded string alloc + copy with _strdup()Chris Dickens2016-01-273-9/+5
| | | | Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Windows: Fix compilation warnings when logging is disabledChris Dickens2016-01-273-7/+7
| | | | Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Windows (usbdk): Remove unnecessary bookkeepingChris Dickens2016-01-272-7/+3
| | | | | | | | The core library will not call the backend's exit() function if the init() function does not succeed, so keeping track of whether init() successfully completed is redundant. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Windows (usbdk): Remove unnecessary/unused structureChris Dickens2016-01-272-8/+2
| | | | Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Misc: Fix up Visual Studio project filesChris Dickens2016-01-2713-66/+79
| | | | | | | | | This commit sorts the source and header files by name (for easier human parsing), adds windows_nt_common.c to the 2010 and 2012 projects, and removes some CPP defines that should not be present in the libusb_static_2015.vcxproj file. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Windows: Source file cleanupChris Dickens2016-01-268-1990/+2009
| | | | | | | | | | | | This commit addresses a few different issues: 1) Whitespace made consistent with the rest of the library source 2) Formatting of function and variable declarations made consistent with the rest of the library source 3) Functions and variables made static where possible 4) Definitions in header files moved if not used publicly Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Misc: Minor makefile cleanupChris Dickens2016-01-262-10/+8
| | | | Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* build: Integrate usbdk backendDmitry Fleytman2016-01-2611-4/+753
| | | | | Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com> Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* usbdk: Introduce usbdk backendDmitry Fleytman2016-01-266-1/+1090
| | | | | | Signed-off-by: Pavel Gurvich <pavel@daynix.com> Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com> Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* windows: Rename windows_usb.h/c windows_winusb.h/cDmitry Fleytman2016-01-2321-39/+39
| | | | | Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com> Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* windows: Move common definitions to a separate fileDmitry Fleytman2016-01-2311-555/+711
| | | | | | | New files windows_nt_common.h/c introduced. Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com> Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* linux: Correctly return device configuration when using usbfsChris Dickens2016-01-232-24/+20
| | | | | | | | | | | | libusb_get_configuration() has been broken when using a Linux kernel that requires the use of usbfs to obtain the current configuration value. This commit resolves this issue and also modifies the usbfs_get_active_config() function to update the cached active configuration value itself instead of requiring the callers to do it. Closes #137 Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* WinCE: Fix printf format specifiersChris Dickens2016-01-062-10/+10
| | | | Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Windows: Fix printf format specifiers in poll_windows.cChris Dickens2016-01-062-6/+6
| | | | Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Windows: Fix compiler warnings due to type mismatchesChris Dickens2016-01-063-27/+27
| | | | | | | | | | | | | | | There are some differences in how the DWORD type is defined between native Windwos compilers and Cygwin where the former always uses long and the latter uses long or int depending on the architecture. Since the DWORD type is always 4 bytes, all uses of DWORD in printf are cast to unsigned int, which consistently 4 bytes across all platforms. Other mismatching printf format specifiers were also changed appropriately. Additionally, a type cast is added for _beginthreadex on Cygwin. Closes #106 Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Windows: Use strcasecmp() instead of stricmp() on CygwinChris Dickens2016-01-062-2/+2
| | | | | | | | | Cygwin does not define the latter in all versions, so this commit uses the former POSIX function that Cygwin does provide. Closes #104 Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Examples: fix typo in Nathan Hjelm emailLudovic Rousseau2016-01-062-2/+2
|
* Windows: Add Visual Studio 2015 supportBrent Rector2016-01-0612-2/+1439
| | | | | | | | | | | Modified from original to remove two unnecessary files and address type-casting discrepancies across platforms. Closes #60 Closes #83 Closes #120 Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Windows: Patch to support VirtualHubjohannrichard2016-01-052-2/+2
| | | | | | | | | Integrate VirtualHub (VHHUB) in LibUSB, as per http://libusb.6.n5.nabble.com/libusb-Patch-to-support-VirtualHere-td5714167.html Closes #133 Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Misc: Spelling fixesTobias Klauser2016-01-0510-10/+10
| | | | | | | | | | Fix spelling errors found by codespell, some of them in API documentation and user visible messages. Closes #102 Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Misc: Simplify Haiku build and fix broken parallel buildChris Dickens2015-12-1712-840/+768
| | | | | | | | | | | | | | | | | | The Haiku build was previously being done as a nested package due to its C++ requirement, but for some reason setting SUBDIR in an automake conditional breaks parallel builds. To fix this and simplify the Haiku build process, this commit adds an unconditional check for a C++ compiler using AC_PROG_CXX and builds the Haiku sources as part of the main libusb project. Note that AC_PROG_CXX itself does not cause the configure script to fail if a C++ compiler is not found. Therefore on non-Haiku platforms there is no requirement to have a C++ compiler installed in order to build libusb. Closes #121 Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* API: Add libusb_interrupt_event_handler() functionChris Dickens2015-12-175-2/+36
| | | | | | | | | This new function will allow the user to purposely interrupt an event handling thread, causing it to return from the event handling function. This is mainly useful for cleanly exiting from a dedicated event handling thread during application shutdown. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* core: Store different event types as a bitmask within the contextChris Dickens2015-12-173-10/+16
| | | | | | | | | | This change introduces a new event_flags member to the libusb_context that holds a bitmask of different events that have occurred. This will allow multiple "one-shot" events (those that don't require counting) to be stored in a single variable. The only existing event of this type, pollfds_modified, has been converted to use this bitmask instead. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* darwin: updates to support el capitanNathan Hjelm2015-11-213-7/+79
| | | | | | | | | | | | | | | | With the new USB stack Apple changed the underlying device class from IOUSBDevice to IOUSBHostDevice. Additionally, they removed the PortNum property from the IO registry entry. This commit add code to detect the currently running xnu version. If the version is at least 15 (10.11.0) the new device class is used to find usb devices and the port number is read from the IOService parent of the USB device instead of the PortNum property. Closes #127 May have some effect on either #123 or #96. Signed-off-by: Nathan Hjelm <hjelmn@me.com>