summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add internal abstraction for POSIX Threadsusbi_syncPeter Stuge2010-02-169-134/+182
| | | | | | | | | | | | | This prepares for a Windows backend without dependency on pthreads-w32. pthread_* is renamed to usbi_* and PTHREAD_* to USBI_*. A usbi_mutex_static_t and usbi_mutex_static_lock() and _unlock() are introduced for statically initialized mutexes, since they may be implemented using other types when pthreads mutexes aren't used. Move -pthread from libusb/Makefile.am to host-specific AM_CFLAGS in configure.ac. AM_CFLAGS is already used in Makefile.am.
* Darwin: fix memory leak in process_deviceNathan Hjelm2010-02-151-7/+13
| | | | Credit to Mike Colagrosso for finding this bug.
* Darwin: use logging functionsNathan Hjelm2010-02-152-73/+75
| | | | Use usbi_warn, usbi_err, and usbi_info instead of _usbi_log.
* Darwin: support multiple calls to libusb_initNathan Hjelm2010-02-151-16/+21
| | | | Credit to Orin Eman for finding this bug.
* v1.0.6 releasev1.0.6Daniel Drake2009-11-222-1/+5
|
* lsusb example: make print_devs() staticLudovic Rousseau2009-11-211-1/+1
| | | | lsusb.c:26: warning: no previous prototype for ‘print_devs’
* Darwin: fix warning in darwin_error_str()Ludovic Rousseau2009-11-211-1/+1
| | | | | os/darwin_usb.c:63: warning: return discards qualifiers from pointer target type
* Darwin: allow devices to be opened multiple timesNathan Hjelm2009-11-212-52/+77
| | | | | | | Allows libusb applications to access multiple interfaces of the same device in the same application. Also fixes a set alt interface bug.
* Increase libusb_handle_events() timeout to 60 secondsDaniel Drake2009-11-211-6/+5
| | | | | The internal timing seems to be working, this will be a better test of it before we make this timeout unlimited.
* Refine timerfd header check (#18)Daniel Drake2009-11-212-4/+8
| | | | Require glibc-2.9 for the working timerfd support.
* v1.0.5 releasev1.0.5Daniel Drake2009-11-153-1/+6
|
* Update documentation about early completion caveatsDaniel Drake2009-11-072-51/+44
|
* Add libusb_get_max_iso_packet_size() to libusb.hLudovic Rousseau2009-11-071-0/+1
| | | | core.c:777: warning: no previous prototype for 'libusb_get_max_iso_packet_size'
* Use timerfd for timeout handlingDaniel Drake2009-11-076-78/+392
| | | | | | | | | | | | Use a new file descriptor from the timerfd system calls to handle timeouts. On supported systems, this means that there is less hassle figuring out when the poll() timeout should be, since libusb_get_next_timeout() will always return 0 and the timeout events will be triggered as regular activity on the file descriptor set. Add API function libusb_pollfds_handle_timeouts() to detect whether you're on a platform with the timing headache, and flesh out the surrounding documentation.
* Use AM_SILENT_RULES for buildingDaniel Drake2009-11-071-0/+1
|
* v1.0.4 releasev1.0.4Daniel Drake2009-11-063-1/+8
|
* Linux: Add support for the new URB_BULK_CONTINUATION flagDavid Moore2009-11-062-4/+55
| | | | | | | | | | | | | | | | | | Add support for the new USBDEVFS_URB_BULK_CONTINUATION flag to libusb. This flag, which is expected to be available in usbfs starting with kernel 2.6.32, allows the kernel to cancel multiple URBs upon receipt of a short packet. This capability allows libusb to preserve data integrity of large bulk transfers that are split into multiple URBs. Without this support, these URBs must be canceled in userspace upon receipt of a short packet, a race condition against future transfers which might partially fill these canceled URBs. This patch automatically detects whether a supported kernel is present and enables the use of the flag when possible. [dsd: tweaks to supported kernel detection, and some inline documentation of this mechanism]
* Transfer lockingDaniel Drake2009-11-063-17/+66
| | | | | | | | | | | | At least on Linux, there were some possible races that could occur if a transfer is cancelled from one thread while another thread is handling an event for that transfer, or for if a transfer completes while it is still being submitted from another thread, etc. On the global level, transfers could be submitted and cancelled at the same time. Fix those issues with transfer-level locks.
* Clarify that timeout 0 means unlimited timeoutDaniel Drake2009-09-141-6/+6
|
* Linux: more flexibility with monotonic clockDaniel Drake2009-09-111-2/+46
| | | | | | | | | | | | | Some users have reported that CLOCK_MONOTONIC does not work on their systems - I suspect it is available on x86 but perhaps not some of the more uncommon architectures. We should fall back on CLOCK_REALTIME in these cases. Also, CLOCK_MONOTONIC_RAW seems even more monotonic, so we should use that if it is available. We now test different clock IDs during initialization to find the best one that works.
* Darwin: handle overflowsNathan Hjelm2009-09-111-2/+14
|
* v1.0.3 releasev1.0.3Daniel Drake2009-08-273-3/+12
|
* Darwin: 64-bit type fixesToby Peterson2009-08-231-2/+3
|
* Darwin: fix crash when reading descriptors after closeNathan Hjelm2009-08-231-0/+3
| | | | | Fix a crash which occurs if the user does the following sequence on a device: open, close, get_configuration_descriptor.
* move bug info to bug trackerDaniel Drake2009-08-012-11/+1
| | | | | Protection needed: http://www.libusb.org/ticket/4 Losing data: fixed in previous commit
* Linux: try harder not to lose any dataDaniel Drake2009-07-092-11/+91
| | | | | We would previously lose any data that was present on a cancelled URB. Work harder to make sure this doesn't happen.
* Add libusb_get_max_iso_packet_size()Daniel Drake2009-06-282-27/+101
| | | | | | | | | As pointed out by Dennis Muhlestein, libusb_get_max_packet_size() doesn't really do what the documentation might suggest because it does not consider the number of transaction opportunities per microframe. Add a new function to do what is useful for isochronous I/O.
* Linux: fix sending of zero length bulk packetsDaniel Drake2009-06-201-1/+5
| | | | | Note that there are is a kernel bug preventing this from working properly at the moment, even after this fix.
* Darwin: Don't cancel transfers on timeoutNathan Hjelm2009-06-192-1/+9
| | | | ...because the OS does this for us.
* Don't terminate enums with commasDaniel Drake2009-06-141-12/+12
| | | | | g++ -pedantic doesn't like this Reported by Eberhard Mattes
* v1.0.2 releasev1.0.2Daniel Drake2009-06-133-1/+6
|
* Linux: fix config descriptor parsing on big-endian systemsDaniel Drake2009-06-102-2/+8
| | | | | | | Multi-byte fields in the configuration descriptors that come back from usbfs are always in bus endian format. Thanks to Joe Jezak for help investigating and fixing this.
* Darwin: improve handling of disconnected devicesNathan Hjelm2009-06-071-25/+53
|
* Darwin: fix parsing of config descriptorsNathan Hjelm2009-06-071-16/+43
| | | | | This was a confusion between configuration numbers and zero-based configuration indexes.
* Eliminate -Wsign-compare compiler warningsDaniel Drake2009-06-071-4/+22
| | | | | | This was due to an API inconsistency which can be safely worked around. Hopefully we'll remember to fix the API next time we come to break things.
* Make synchronous transfer APIs robust against signal interruptionDavid Moore2009-05-291-0/+4
| | | | | | | | | | | | libusb_control_transfer and libusb_bulk_transfer are designed to be synchronous such that control is not returned until the transfer definitively succeeds or fails. That assumption is violated if a signal interrupts these functions because there is no way for the application to continue waiting for the transfer without resubmitting it. This patch changes these synchronous APIs so they do not abort in the case of a signal interruption. Signed-off-by: David Moore <dcm@acm.org>
* pre-gcc-3.4 compatibilityAlex Vatchenko2009-05-283-3/+22
| | | | | The -fvisibility and -Wno-pointer-sign options are not available on old GCC versions.
* Fix memory leak in config descriptor parsingDaniel Drake2009-05-261-0/+2
| | | | Pointed out by Martin Koegler.
* Update AUTHORSDaniel Drake2009-05-121-0/+3
|
* v1.0.1 releasev1.0.1Daniel Drake2009-05-122-1/+5
|
* Add BUGS fileDaniel Drake2009-05-122-1/+11
| | | | Probably missed a couple of outstanding issues
* Darwin: get_config_descriptor bugfixesNathan Hjelm2009-03-221-5/+23
|
* Fix compilation of Darwin backendDaniel Drake2009-02-251-2/+2
| | | | My fault. Reported by ihryamzik@gmail.com
* Darwin backendNathan Hjelm2009-02-168-3/+1637
|
* Make endianness macros endian-independentNathan Hjelm2009-02-161-14/+13
| | | | | Implementation suggested by David Moore. Needed for proper universal code support on Darwin.
* Abstract clock reading into OS layerNathan Hjelm2009-02-163-4/+33
| | | | | | This will differ on Linux and Darwin, at least. [dsd: minor style tweaks]
* Fix endianness in device descriptorsDaniel Drake2009-02-161-5/+5
| | | | Pointed out by Nathan Hjelm.
* Only link with librt on LinuxNathan Hjelm2009-02-162-1/+1
| | | | [dsd: tweak configure.ac change]
* API docs: describe libusb_transfer_cb_fn typeHans Ulrich Niedermann2009-02-011-0/+9
| | | | | | | | Add some text describing the libusb_transfer_cb_fn function type with the semantics I have gathered from reading other parts of the API docs, referring to the proper section for more details. [dsd: tweaked the description slightly]
* Make empty array in struct compatible with C99Hans Ulrich Niedermann2009-02-011-1/+7
| | | | | | | | If the compiler is known to be running in C99 mode, use "flexible array members" ("foo[]"). If the compiler is running in any other mode, continue using the non-standard but widely common "foo[0]" syntax.