summaryrefslogtreecommitdiff
path: root/libusb/core.c
Commit message (Collapse)AuthorAgeFilesLines
* removed trailing whitespaces (core)Peter Stuge2010-03-181-1/+1
|
* residual corrections from previous commits (Michael Plante)r189Pete Batard2010-03-031-1/+1
|
* renamed unistd_posix.h to poll_posix.hPete Batard2010-03-021-1/+1
|
* fixed MinGW warningsPete Batard2010-03-021-1/+0
|
* poll fd notification improvements (core)Pete Batard2010-03-021-30/+45
| | | | factorized code from libusb_open into new function usbi_fd_notification
* fixed a typo in usbi_mutex_unlockr179Pete Batard2010-02-261-0/+1
| | | | also added mutex release in libusb_unref_device
* reverts some of the changes from dbd439/6c7a1e (r173)r175Pete Batard2010-02-241-1/+1
|
* includes simplification and cleanup (core)Pete Batard2010-02-241-3/+1
|
* renamed _libusb_ unistd calls to usbi_r172Pete Batard2010-02-241-4/+4
|
* moved standard calls redefinitions into a separate .hPete Batard2010-02-241-7/+1
| | | | This applies to read/write/close/poll/pipe -> unistd_posix.h
* merge abstraction for POSIX Threads and integration changes (Michael Plante, ↵r169Pete Batard2010-02-241-63/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Peter Stuge) v1.0.6 release Darwin: support multiple calls to libusb_init Credit to Orin Eman for finding this bug. Darwin: use logging functions Use usbi_warn, usbi_err, and usbi_info instead of _usbi_log. Darwin: fix memory leak in process_device Credit to Mike Colagrosso for finding this bug. Add internal abstraction for POSIX Threads 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. (Numerous merge conflicts resolved by Michael Plante) misc fixes to pthreads abstraction * windows_compat.h should not be directly included (use libusbi.h) * windows_usb.c still had some references to pthread_mutex_[un]lock Add libusb_strerror() to get short error message in English from enum (Merge conflicts resolved by Michael Plante) Better cleanup on errors, stricter types and some good casts Avoid various memory leaks in error code paths and remove warnings. Also add usbi_cond_destroy in os/threads_posix.h because it's used for cleanup now. (Merge conflicts resolved by Michael Plante) Rename all interface parameters to usb_interface or interface_number (Merge conflicts resolved by Michael Plante) Add type parameter to the list_for_each_entry() and _safe() macros (Merge conflicts resolved by Michael Plante) VA_ARGS workaround for logging with MSVC6 (Merge conflicts resolved by Michael Plante) Fix context memory leak in libusb_init() * Now holds default_context_lock for duration of libusb_init * Doesn't allocate it if not needed Fix the last MSVC /W3 warning removal of pthreads from MSVC and mingw * removed pthread*.lib from linking in msvc6 (2005/8 not yet edited) * added threads_windows.[ch] to all project files in msvc6 * added usbi_cond_signal to both threading versions, unused * added native windows threading code, now used removed redundant time.h includes removed pthread-win32 informational solution files updated MSVC 2005/2008 for thread abstraction fixed DDK build fixed cygwin's use of POSIX threads fixed dpfp/dpfp_threaded for MinGW compatibility config_msvc.h -> msvc/config.h pthread abstraction for DLL project files fixed bad reference to thread_windows in 2005 DLL vcproj cygwin ifdef is not required in threads_windows.h - removed fixed residuals from previous patches moved thread source detection into autotool scripts
* fixed libusb_strerror to be in line with core patch 6/7r154Pete Batard2010-02-151-34/+32
|
* r140: further simplification of the core include sectionsr140Pete Batard2010-02-031-4/+1
|
* r123: reverted the use of usb_interface in core and forced interface to be ↵Pete Batard2010-01-291-1/+1
| | | | undefined always on Windows
* r122: fixed poll conflict on cygwin (all compat functions renamed to ↵Pete Batard2010-01-281-8/+9
| | | | | | | _libusb_####) - fixed sscanf_s undefined for non MS compilers - fixed cygiwn warnings in windows_usb.c
* r117: fixed missing API_EXPORTED for the new libusb_strerror callPete Batard2010-01-261-1/+1
|
* r115: added libusb_strerror (Francesco Montorsi)Pete Batard2010-01-251-0/+46
|
* r111: destroy core.c mutexes when done, and fix a few unlikely memory leaksMichael Plante2010-01-241-1/+13
|
* r106: Fixed leak in usbi_alloc_device when pthread_mutex_init failsMichael Plante2010-01-241-1/+3
|
* r85: fixed MSVC warnings for x64 and reverted ssize_t to int for ↵Pete Batard2010-01-161-4/+4
| | | | libusb_get_device_list change introduced with r52. Added definition on ssize_t in libusb.h for MSVC platforms.
* r80: workaround for interface macro redefinition on Windows (removes the ↵Pete Batard2010-01-151-13/+13
| | | | need for #undef interface in end user sources)
* Fix CR/LF inconsistenciesPete Batard2010-01-141-3/+3
|
* svn r59: - MSVC6 fixes for variadic log macros (Michael Plante)Pete Batard2010-01-141-5/+12
|
* svn r54: - fixes missing config_msvc.hPete Batard2010-01-141-6/+8
|
* svn r29:Pete Batard2010-01-141-13/+13
| | | | | - "poll we can believe in" (requires superficial modifications to core files) - move the "interface" fix into windows_compat.h
* svn r4: revert back to using interface for variable names as in master branchPete Batard2010-01-141-13/+18
|
* mirror libusb-winusb git branch from 2009.12.03 part 2 - core filesPete Batard2010-01-141-13/+19
|
* Update documentation about early completion caveatsDaniel Drake2009-11-071-51/+40
|
* Linux: try harder not to lose any dataDaniel Drake2009-07-091-0/+56
| | | | | 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-281-22/+91
| | | | | | | | | 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.
* Darwin backendNathan Hjelm2009-02-161-1/+3
|
* Avoid signedness errors in API docs example codeHans Ulrich Niedermann2009-01-311-2/+2
|
* EOL-whitespace fixesMikhail Gusarov2008-12-131-3/+3
| | | | Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.ent>
* Pause event handling while opening and closing devicesDaniel Drake2008-11-211-31/+122
| | | | | | | | | | | | | | | 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-031-0/+25
| | | | | | Add support for re-attaching a driver to a device under Linux. [dsd: fixed handling of return value, and added LIBUSB_ERROR_BUSY case]
* Document the logging styleDaniel Drake2008-11-021-0/+11
| | | | Suggested by Lou.
* Introduce contexts to the APIDaniel Drake2008-06-261-55/+124
| | | | | Suggested by David Zeuthen. This allows multiple libraries in the same process to independently use libusb without interfering.
* Refine configuration selection againDaniel Drake2008-06-161-42/+72
| | | | | | At Alan Stern's suggestion, just offer the bare "set configuration" and "get configuration" functionality, and let applications worry about the specific race conditions and unusual situations.
* fix doc about libusb_open()Felipe Balbi2008-06-151-1/+6
| | | | | | | libusb_open() returns int instead of libusb_device_handle. Signed-off-by: Felipe Balbi <me@felipebalbi.com> [dsd: small correction]
* Refine libusb_set_configuration() semanticsDaniel Drake2008-05-291-3/+86
| | | | | | | | | | | | | Applications will generally want to set a configuration before claiming interfaces. The problem is that the interface may already be set, and someone else may have claimed an interface (meaning that all calls to set_configuration will fail, even if it's for the same configuration). There are now 2 options: 1. Use the new libusb_get_configuration() to determine active configuration before calling libusb_set_configuration() 2. Or just call libusb_set_configuration() as usual, which will do nothing if that configuration is already active.
* Implement serialization of event handlersDaniel Drake2008-05-251-1/+1
| | | | | | Now offers a mechanism to wait for events while another thread is doing the event handling. Complicates things for MT async apps, but then again it's a bit of a tricky combination to start with.
* allow LIBUSB_DEBUG env var to control message verbosity at runtimeDaniel Drake2008-05-241-5/+50
| | | | Based on ideas from Ludovic Rousseau
* don't print messages by defaultDaniel Drake2008-05-231-0/+34
| | | | | | | Add libusb_set_debug() API to set message verbosity. Ludovic Rousseau pointed out that applications may close stdout/stderr descriptors, which might then be reused.
* More informative libusb_open() return codeDaniel Drake2008-05-161-19/+30
| | | | Hopefully one of the last API tweaks...
* Fix endianness with descriptor handlingDaniel Drake2008-05-161-1/+2
| | | | | Alan Stern pointed out that usbfs gives host-endian data, but sysfs gives bus-endian.
* Backend documentation for porting effortsDaniel Drake2008-05-131-3/+9
| | | | Hopefully comprehensive enough for people to get started.
* Handle hot-unpluggingDaniel Drake2008-05-111-4/+20
| | | | | This involved moving from select() to poll() because there is no way to distinguish usbfs's POLLERR condition with select().
* Documentation workDaniel Drake2008-05-111-2/+41
|
* Endianness of control setup packetsDaniel Drake2008-05-111-5/+1
| | | | | | | | Document behaviour where host-endian and bus-endian (little) should be used respectively. Also remove packed attribute from libusb_control_setup as all fields are naturally aligned.
* Document that releasing interface causes SET_INTERFACE control requestDaniel Drake2008-05-111-1/+2
|