summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Avoid signedness errors in API docs example codeHans Ulrich Niedermann2009-01-311-2/+2
|
* Decrement poll() result when internal pipe has been handledDaniel Drake2009-01-171-0/+1
| | | | | | When we receive data on the internal control pipe, we need to correctly decrement the number of ready file descriptors before passing on the remaining work to the OS implementation.
* Prevent transfer from being submitted twice or improperly canceledDavid Moore2009-01-122-11/+35
| | | | | | | | | | This ensures that tpriv->urbs and tpriv->iso_urbs are always set to NULL whenever a transfer is not submitted. In this way, submit_*_transfer() and cancel_*_transfer() can error check to ensure that the transfer is in the correct state to be either submitted or canceled, preventing potential memory leaks or double frees. Signed-off-by: David Moore <dcm@acm.org>
* Linux: Fix race condition in cancel_bulk_transfer()David Moore2009-01-101-98/+38
| | | | | | | | | | | | | | | | | | | | | | | This fixes a race condition in cancel_bulk_transfer(). In the old version, awaiting_reap and awaiting_discard are incremented in cancel_bulk_transfer() and decremented in handle_bulk_completion(). However, since these events may take place in two different threads, these variables may reach zero before all URBs have been canceled, triggered spurious callbacks and duplicate frees. This changes the logic to use a single variable "num_retired" to replace both awaiting_reap and awaiting_discard. num_retired is incremented only in handle_bulk_completion() and thus there is no race. The handler will know that all URBs have been canceled when num_retired becomes equal to num_urbs. This change also simplifies a great deal of the logic in both functions and is a net reduction in the amount of code. Note that some variables such as "reap_action" probably need to still be protected by a mutex, and this patch does not address that issue. Signed-off-by: David Moore <dcm@acm.org>
* v1.0.0 releasev1.0.0Daniel Drake2008-12-132-1/+4
| | | | It's here!
* EOL-whitespace fixesMikhail Gusarov2008-12-132-14/+14
| | | | Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.ent>
* Linux: fix reading of active configurationDaniel Drake2008-12-091-1/+1
| | | | | Shannon Chuang pointed out that we only read 1 byte into an uninitialized integer, and then return the whole thing.
* Fix double free in descriptor parsing error pathDaniel Drake2008-12-091-0/+1
| | | | Pointed out by Shannon Chuang.
* Improvements to multi-threaded I/O systemDaniel Drake2008-11-212-4/+138
| | | | | | Documentation brushed up, and I realised that another function is needed for tight event handling loops -- they must be able to check if an open/close operation is trying to interrupt it.
* SourceForge website upload system changedDaniel Drake2008-11-211-1/+1
|
* v0.9.4 releasev0.9.4Daniel Drake2008-11-213-1/+8
|
* Pause event handling while opening and closing devicesDaniel Drake2008-11-213-37/+205
| | | | | | | | | | | | | | | Ludovic Rousseau found that crashes often occur if you close a device while another thread is doing event handling. Fix this by adding an internal control pipe, which the close routines use to interrupt the event handler and obtain the event handling lock, ensuring that no other thread is handling events while the device is closed. After the close completes, it signals all the event handlers to start up again using the usual mechanism. Also modified libusb_open() to do a similar thing, so that event handlers are interrupted in order to realise that a new poll fd has appeared.
* Add libusb_attach_kernel_driver()Bastien Nocera2008-11-034-0/+76
| | | | | | Add support for re-attaching a driver to a device under Linux. [dsd: fixed handling of return value, and added LIBUSB_ERROR_BUSY case]
* Linux: handle low-level transfer errorsDaniel Drake2008-11-021-11/+40
| | | | Handle more URB error status codes, thanks to Lou and Alan Stern.
* Support for out-of-tree buildingAurelien Jarno2008-11-023-4/+4
| | | | | | | Contrary to libusb 0.1, libusb 1.0 does not support out-of-tree building for the documentation part. This patch fixes that by using a doxygen.cfg.in file, which contains @top_srcdir@ to refer to the location of the libusb source code.
* Document the logging styleDaniel Drake2008-11-021-0/+11
| | | | Suggested by Lou.
* Async I/O documentation touchupsDaniel Drake2008-08-272-6/+18
|
* Doc: fix typo in events lock sectionDaniel Drake2008-08-271-1/+1
|
* v0.9.3 releasev0.9.3Daniel Drake2008-08-232-1/+4
|
* Reset internal transfer flags on submitDaniel Drake2008-08-231-0/+1
| | | | | | This fixes a problem pointed out by Lou, where resubmitting a transfer that previously timed out never timed out again, as if the timeout had been set to 0.
* Add libusb_get_configuration prototypeDaniel Drake2008-08-101-0/+1
| | | | Pointed out by Lou
* v0.9.2 releasev0.9.2Daniel Drake2008-07-192-1/+4
|
* Linux: fix sysfs directory handlingDaniel Drake2008-07-162-4/+9
| | | | | 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.
* Linux: correct usage of MAX_PATHDavid Engraf2008-07-161-6/+6
| | | | | Thanks to clarification from Artem Egorkine, MAX_PATH already includes space for the trailing NULL.
* Linux: fix bulk/iso transfer double-cancellationDaniel Drake2008-07-081-0/+4
| | | | | | 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.
* v0.9.1 releasev0.9.1Daniel Drake2008-06-282-1/+6
|
* Add missing GET_CONTEXT()Daniel Drake2008-06-281-0/+1
|
* Linux: Compatibility with new sysfs descriptors fileDaniel Drake2008-06-282-83/+156
| | | | | As of 2.6.26, the descriptors file now includes all descriptors, not just the active one.
* Allow user data pointer to be passed through pollfd notification APIDaniel Drake2008-06-263-6/+16
|
* Introduce contexts to the APIDaniel Drake2008-06-2611-398/+606
| | | | | Suggested by David Zeuthen. This allows multiple libraries in the same process to independently use libusb without interfering.