summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* libusbx-1.0.13v1.0.13Pete Batard2012-09-203-3/+3
|
* Internal: Add fxload exe and sources to the Windows binary snapshotPete Batard2012-09-192-1/+5
|
* Misc: Update copyrights, TODO and libusb_version.describePete Batard2012-09-185-16/+9
| | | | * Changes suggested by Chuck Cook & Xiaofan Chen
* libusbx 1.0.13-rc2v1.0.13-rc2Pete Batard2012-09-163-4/+5
| | | | * Also update NEWS with regards to isoc support for the 0/K Windows drivers
* Doc: Fix doxygen warnings and issuesPete Batard2012-09-164-14/+5
| | | | | | | | * Remove obsolete tags * Use QUIET = yes to make issues more prominent * Fix code display for LIBUSBX_API_VERSION and missing parameter documentation for libusb_get_port_path() * Most of the above suggested by Ludovic Rousseau
* Misc: Fix missing files from dist packagePete Batard2012-09-163-4/+4
|
* libusbx 1.0.13-rc1v1.0.13-rc1Pete Batard2012-09-166-7/+53
|
* Core: Introduce LIBUSBX_API_VERSION macroPete Batard2012-09-152-1/+24
| | | | | | * This macro can be used to detect if the version of libusbx being compiled against has a specific API feature, as well as to detect whether compilation occurs against libusb or libusbx.
* Core: Make libusb_error_name also handle transfer status codesHans de Goede2012-09-153-6/+25
| | | | | | Note that for the code 0 which means success resp. completed we have an overlap in the codes. This is not a problem since normally one would not call libusb_error_name on success / normal completion.
* Samples: Fix compiler warnings in fxloadLudovic Rousseau2012-09-152-8/+13
| | | | | | | | | | | | ezusb.c: In function "ezusb_cpucs" ezusb.c:163: warning: initialization discards qualifiers from pointer target type ezusb.c: At top level: ezusb.c:193: warning: no previous prototype for "parse_ihex" ezusb.c:340: warning: no previous prototype for "parse_bin" ezusb.c:377: warning: no previous prototype for "parse_iic" ezusb.c: In function "ram_poke": ezusb.c:451: warning: enumeration value "_undef" not handled in switch ezusb.c:491: warning: passing argument 2 of "ezusb_write" discards qualifiers from pointer target type
* Core: Update libusb.h header in accordance with the latest USB specsPete Batard2012-09-153-9/+21
| | | | | | | | | | | | | | * IMPORTANT: This update fixes a typo in the API where MaxPower was being used instead of bMaxPower, with the latter being what is actually in the specs. * As a result, applications that were using MaxPower need to be updated for bMaxPower. * If you must maintain compatibility with libusb or older versions of libusbx, you may also want to either use a #define or copy/paste struct libusb_config_descriptor from libusb.h under a new name, and then use a cast on calls that require it. For more info, see the 1.0.13 release notes in the NEWS file. * Also update copyright notice
* Samples: Display VID:PID of the tested device in xusbLudovic Rousseau2012-09-142-3/+3
| | | | | * Also amend the wording of the "no option" comment. * Closes #42
* Windows: Switch to ALLOW_PARTIAL_READS pipe policy enabled by defaultPete Batard2012-09-142-3/+5
| | | | | | * This avoids an issue when libusbK is used for bulk transfers, which is most likely due to a libusbK bug * See https://sourceforge.net/mailarchive/message.php?msg_id=29736015
* Samples: Add fxload sample for Cypress EZ-USB chipsPete Batard2012-09-1317-2/+3150
| | | | | | | | * This program was modified from the original fxload at: http://linux-hotplug.sourceforge.net to add libusbx as well as non HEX images support. * Only supports RAM upload for now, with EEPROM and FX3 support to be added at a later stage.
* All: Avoid polluting errors reported on device disconnectHans de Goede2012-09-133-3/+4
| | | | | | | | * Makes libusb_cancel_transfer not log an error when the cancel fails with LIBUSB_ERROR_NO_DEVICE, so that apps can properly clean things up on device disconnect without flooding the console with these errors. * Also, some devices (Cypress FX) may switch VID:PID on the fly during firmware upload => reduce severity of the Windows message when that happens.
* Doc: Update logging documentation regarding stderr usagePete Batard2012-09-132-14/+17
|
* Windows: Fix handling of composite devicesPete Batard2012-09-053-39/+18
| | | | | | | | * Pass missing sub_api parameter to set_composite_interface() and composite_submit_control_transfer() * Remove api_flags attribute, that cannot apply for multiple interfaces * Also simplifies the internal ENUM_DEBUG mode * Also move polluting info logging message to debug
* Samples: xusb improvementsPete Batard2012-09-052-22/+29
| | | | | | * update and fix usage details * make topology and speed printout optional (option -i) * remove unneeded option -g
* Windows: Suppress unwanted error message on filter driverPete Batard2012-08-272-3/+3
| | | | | * Interface access error message was unconditional, even if the filter driver was found later on.
* Linux: Return ERROR_NOT_FOUND in detach-kernel-driver if usbfs is already boundHans de Goede2012-08-233-1/+11
| | | | | | | | | | | | | | * Currently applications for devices which only are accessed from userspace can use claim / release interface to make sure they don't get in each others way. * The same however does not work for applications which first need to detach a "native" / in kernel driver, as this detach will not only detach native drivers but also the usbfs driver, thus stealing the device from another userspace / libusbx app. * This patch fixes libusb_detach_kernel_driver to only detach "real" kernel drivers and not the special usbfs driver used for userspace access to USB devices. If the usbfs driver is found LIBUSB_ERROR_NOT_FOUND will be returned to indicate no driver was detached.
* Linux: Avoid unnecessary splitting of bulk transfersHans de Goede2012-08-232-13/+58
| | | | | | | | | | | | | | * With the latest kernels it is no longer needed to always split large bulk transfers into multiple urbs. This patch takes advantage of this by not splitting when not necessary. Note that the non-split code path is in essence using the old split code path with an urb count which is always 1. * This leads to more sane handling of large transfers with recent kernels, although our splitting code is well tested, not splitting at all still is a lot better :) * When used with a recent kernel, this also fixes the problems, on XHCI attached devices, when a large bulk-in transfer ends with a short read in an urb other then the last urb. * For more on this see: http://marc.info/?l=linux-usb&m=133797554910355
* Linux: Add support for the new get_capabilities ioctlHans de Goede2012-08-233-5/+31
| | | | | | | | | | | | | | | * There were a few (new) usbdevfs capabilities which libusbx could not discover in any other way then checking the kernel version. * However, this presents the following problems: 1) It is just not very pretty 2) Given the tendency of enterprise distros to backport stuff it is not reliable 3) Some of these features turn out to not work with certain host controllers, making depending on them based on the kernel version not a good idea * Therefore a new USBDEVFS_GET_CAPABILITIES ioctl has been added to the kernel to offer a better way to find out a device's capabilities (technically the capabilities of the host controller to which the device is attached, but that does not matter).
* Core: Handle >= 1 second transfer timeout in libusb_submit_transfer()Peter Stuge2012-08-222-5/+4
| | | | | | | | * Comparisons between tv_nsec and 1 sec should be >= rather than >, as we can end up in situations where tv_nsec is exactly 1000000000, which calls such as timerfd_create() do not accept. * Issue reported by Sebastian K. See: https://sourceforge.net/mailarchive/message.php?msg_id=29706972
* Misc: Update and shorten various libusbx URLsPete Batard2012-08-229-16/+14
|
* Windows: Add support for 2nd gen Renesas USB 3.0 controllersNicholas Corgan2012-08-222-2/+2
| | | | | * Driver version 3.0.20.0 for uPD720201 & uPD720202 uses RUSB3HUB * Closes #40
* Windows: Add libusbk.sys & libusb0.sys driver supportPete Batard2012-08-203-332/+751
| | | | | | | | * Both libusbk and libusb0.sys rely on libusbk.dll being installed to provides a WinUSB-like API for driver access. * In case libusbk.dll is not present, fall back to WinUSB. * Closes #11 * Closes #12
* Windows: Fix C4005 warning under VS2012 for inline.Anthony Clay, ZarthCode LLC2012-08-202-1/+3
| | | | | * Changed inline macro to not fire when using Visual Studio/C++, which attempts to redefine the macro - resulting in a C4005 warning.
* Samples: Make target mandatory with -b option in xusbPete Batard2012-08-122-9/+7
|
* Core: Improve instrumentation of timerfd_settime failuresPete Batard2012-08-122-3/+4
| | | | | * Report errno as well as itimerspec data * Also reuse the timeout variable set to &transfer->timeout
* Core: Fix a Clang warning in io.cPete Batard2012-08-123-3/+4
| | | | | | | * Using sizeof() in the UNUSED() macro didn't silence all unused variable warnings. * Also fix an "unused ctx" warning when ENABLE_DEBUG_LOGGING is on * Also improve debug output on libusb_open() failure
* Windows: Add workaround for Intel USB 3.0 root hubsMatthias Bolte2012-08-062-6/+8
| | | | | | | | * Intel USB 3.0 root hubs are similar to the Nec/Renesas USB 3.0 root hubs as they aren't listed under "USB" either but under "IUSB3". * Extend the existing workaround for Nec/Renesas USB 3.0 root hubs to handle the Intel ones as well. * Closes #39
* Core: Fix unconditional disarming of timerfdPete Batard2012-08-042-92/+83
| | | | | | | | | | | | * Existing code appears disarms the timerfd always, which cancels pending timeouts as soon as one packet completes. * This fix moves the disarming of the timerfd to arm_timerfd_for_next_timeout(), where it is now done conditionally. It also avoids calling disarm outside of the above call. * This patch also ensures that all handling of the timerfd is done under the flying transfers lock. * Issue reported by Hans de Goede. For more info, see: https://sourceforge.net/mailarchive/message.php?msg_id=29442693
* Core: NULL list pointers on deletionOrin Eman2012-08-033-6/+5
| | | | | | | * This aims at highlighting unwanted behaviours on list operations, and facilitate early detection of potential bugs. * This also requires a fix in threads_windows.c * See http://sourceforge.net/mailarchive/message.php?msg_id=29626351
* Misc: Add a readme for git userPete Batard2012-08-012-1/+31
| | | | | * Suggested by Yves Arrouye: http://sourceforge.net/mailarchive/message.php?msg_id=29577839
* Windows: Set device number for root hubs to 1Pete Batard2012-07-182-3/+6
| | | | | | | * Other platforms (Linux, OS-X) appear to use 1 => follow suit. * For non root hub devices, we simply increment the USB device address. * Collisions with device address 0 are not expected, but we add an assertion for just in case.
* Windows: Fix overflow when handling HID or composite devicesPete Batard2012-07-173-9/+20
| | | | | | | | | | | * When libusb_get_device_list() is called mutliple times, the HID device path was unconditionally duplicated in the list of device's interfaces. * Because array boundaries were not checked, this caused overflow and crash. * This patch adds an out of bound check and also ensures that duplication of data, for HID and composite, does not occur * It also renames the private composite_api_flags to api_flags, as well as reorganizes the private attributes * Bug report and part of the fix provided by Toby Gray
* Windows: usbi_cond_destroy() should free handles created by usbi_cond_intwait().Simon Haggett2012-07-172-1/+2
| | | | * Without this change every call to usbi_cond_destroy() leaks an event handle.
* All: Replace malloc+memset with callocDavidlohr Bueso2012-07-134-13/+7
|
* Core: Prefix LOG_LEVEL_ with LIBUSB_ to avoid conflictsPete Batard2012-07-035-37/+37
| | | | | | | | | * The LOG_LEVEL_ enums, that were moved to the public API in 933a319469bcccc962031c989e39d9d1f44f2885 may conflict with applications/headers that also define their own LOG_LEVEL_ values internally. * As a matter of fact, as per Trac #31, this produces a conflict with libusb-compat, as it defines its own levels.
* Misc: Fix more Clang warnings in core and darwinPete Batard2012-07-026-5/+7
| | | | | | | | | | * http://sourceforge.net/mailarchive/message.php?msg_id=29418038 * core.c:700:4: warning: Function call argument is an uninitialized value * darwin_usb.c:1713:11: warning: Access to field 'cfSource' results in a dereference of a null pointer (loaded from variable 'hpriv') * sync.c/dpfp.c/dpfp_threaded.c: warning: Result of 'malloc' is converted to a pointer of type 'unsigned char', which is incompatible with sizeof operand type
* Windows: Address MSVC Level 4 & WDK's OACR/Prefast warningsPete Batard2012-07-0210-41/+58
| | | | | | | | | | | | | * The library is now compiled with warning level 4 for VS2010 * Move silencing of 4200, 28125 and 28719 to msvc/config.h * Add fixes in core to silence unused variables warnings * Ensure that spinlock is always set interlocked in poll_windows * Add missing check for calloc return value * Fix data assignation in conditionals warnings * Fix an OACR/Prefast error related to the use of strncpy in xusb.c * Also fixes whitespace inconsistencies in core * Issues reported by Orin Eman and Xiaofan Chen. See: https://sourceforge.net/mailarchive/message.php?msg_id=29412656
* Windows: Some versions of dlltool require a library nameXiaofan Chen2012-06-252-2/+2
| | | | | | | * Even though the library name is optional as specified by Microsoft, some recent versions of libtool require one in libusb-1.0.def. * Reference thread in MinGW-w64 mailing list. http://comments.gmane.org/gmane.comp.gnu.mingw.w64.general/5141
* Windows: Fix warnings reported by the Intel CompilerPete Batard2012-06-253-12/+9
| | | | | | | | | * windows_usb.c(161): warning #181: argument is incompatible with corresponding format string conversion * windows_usb.c(2124): warning #111: statement is unreachable usbi_dbg("ERROR: broken timer thread"); * multiple: warning #188: enumerated type mixed with another * Issues reported by Orin Eman
* libusbx-1.0.12v1.0.12Pete Batard2012-06-153-6/+6
|
* Samples: Remove USB version for speed designations in xusbXiaofan Chen2012-06-142-3/+3
|
* Windows: Fix erroneous pointer array allocation reported by ClangPete Batard2012-06-132-2/+2
| | | | | | | * Result of 'calloc' is converted to a pointer of type 'unsigned char *', which is incompatible with sizeof operand type 'PUSB_CONFIGURATION_DESCRIPTOR' * priv->config_descriptor is indeed an array of pointers, with each descriptor allocated, rather than a sequential list of fixed descriptor.
* Core: Fix Clang warningsPete Batard2012-06-134-6/+10
| | | | | | | | | | | | | | | core.c: * Result of 'malloc' is converted to a pointer of type 'struct libusb_device *', which is incompatible with sizeof operand type 'void *' * Memory is never released; potential leak of memory pointed to by 'devs' * Assigned value is garbage or undefined (due to potentially empty and uninitialized device list) descriptor.c: * Function call argument is an uninitialized value io.c: * Call to 'malloc' has an allocation size of 0 bytes * Branch condition evaluates to a garbage value (due to get_next_timeout returning a negative error code instead of zero on error)
* libusbx 1.0.12-rc1v1.0.12-rc1Pete Batard2012-06-114-3/+17
|
* Autotools: add libusb-1.0.def and libusb_nano.h as dependenciesPete Batard2012-06-113-4/+4
| | | | | * Also add version_nano.h to EXTRA_DIST as it is not added to the dist archive by default
* Windows: Enable MinGW and MSVC DLL interchangeabilityPete Batard2012-06-083-1/+12
| | | | | | | | | | * Because we use the WINAPI calling convention, the def file MUST have the @n aliases. There is no way around this as MinGW's .o use decoration always for __stdcall, which can't be turned off. * dlltool must therefore be invoked to create a proper import lib from the .def, using the --kill-at option. * To do that, a CREATE_IMPORT_LIB autotools variable is introduced. * Note: the .def file is currently maintained manually.