summaryrefslogtreecommitdiff
path: root/libusb/os
Commit message (Collapse)AuthorAgeFilesLines
* merge abstraction for POSIX Threads and integration changes (Michael Plante, ↵r169Pete Batard2010-02-249-130/+472
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* improved HID feature reportsr168Pete Batard2010-02-222-28/+54
|
* updated copyright notice and credits in sourcer167Pete Batard2010-02-204-6/+8
|
* added detection of uninitialized devices on openr166Pete Batard2010-02-191-0/+6
|
* fixed cygwin warningr165Pete Batard2010-02-191-1/+1
|
* fixed improper parent when reusing device + cosmetics fixesr164Pete Batard2010-02-181-2/+6
|
* ERROR_SEM_TIMEOUT + FORCE_INSTANT_TIMEOUTS for cancellationr161Pete Batard2010-02-181-1/+16
| | | | | added ERROR_SEM_TIMEOUT case in windows_transfer_callback, FORCE_INSTANT_TIMEOUTS compilation option + uint8_t fix for ddk_build
* fixed HID feature reportsr160Pete Batard2010-02-171-8/+23
|
* improved windows_set_configurationr159Pete Batard2010-02-171-1/+5
|
* removed unofficial versioning from commentsr158Pete Batard2010-02-171-4/+4
|
* fixed aggressive transfer cancellationr157Pete Batard2010-02-171-13/+15
|
* revert back to call copy_transfer_data always in callbackr156Pete Batard2010-02-161-6/+1
| | | | previous change there was unnecessary and actually messed up control transfers
* fixed HID interrupt transfers + HID cosmetics improvementsr155Pete Batard2010-02-161-11/+21
|
* fixed signed/unsigned comparison: int->size_tr153Michael Plante2010-02-121-2/+2
|
* moved real-time functionality out of timer thread (Michael Plante)r152Pete Batard2010-02-121-104/+96
| | | | | also cleanup single-index arrays, remove unnecessary goto and additional cleanup
* fix 2 timer-related bugs (unlikely)r151Michael Plante2010-02-121-4/+5
| | | | | * failed to check CreateSemaphore() * index out of bounds on timer_index
* added detection of HID report IDs for interrupt transfersr150Pete Batard2010-02-112-8/+105
| | | | | processing of HID report IDs in hid_open using HidP_GetValueCaps added corresponding DLL call
* changed HID_USE_LAST_REPORTS to USE_HIDD_FOR_REPORTSr149Pete Batard2010-02-111-4/+9
| | | | clarification for the compilation option above
* fixed bad HID input report data when using controlr148Pete Batard2010-02-112-2/+9
| | | | | removes the use of transfer->buffer as dest in hid_copy_transfer_data uses private hid_dest copy from windows_transfer_priv instead
* final fix for composite HID mouse and keyboard detectionr147Pete Batard2010-02-102-19/+29
| | | | introduces the use of multiple driver names in the USB API backends
* fixed memory leak dues to HID collections in set_composite_devicer146Pete Batard2010-02-101-6/+15
|
* r145: fixed memory leak in _libusb_pollr145Pete Batard2010-02-091-15/+27
|
* r144: preliminary fix for composite HID mouse and keyboard detectionr144Pete Batard2010-02-081-0/+11
|
* r143: fixed a couple of issues with HIDr143Pete Batard2010-02-081-4/+8
|
* r142: - fixed claiming of interfaces >0 for non-composite (Dave C.) + better ↵r142Pete Batard2010-02-072-28/+43
| | | | | | | autoclaim handling - moved compilation options from config_msvc.h to windows_usb.c - processed remaining TODOs
* r141: HID I/O Overhaul:r141Pete Batard2010-02-062-86/+217
| | | | | | | | - discard report ID from buffer (new hid_buffer in transfer_priv & new copy_transfer_data backend call) - overflow detection - extended HID xusb test Also: - fixed ill placed memset on composite device siblings detection
* r139: improved CancelIoEx vs CancelIo detection(Michael Plante, Orin Eman)r139Pete Batard2010-02-031-13/+11
|
* r138b: oops - don't leave debug code in commits!r138bPete Batard2010-02-031-1/+0
|
* r138: additional DDK/SDK versions checks for cancel_io inline (MSVC7+ users ↵r138Pete Batard2010-02-031-1/+6
| | | | only)
* r137: compat layer TODOs and small fixes:r137Pete Batard2010-02-024-22/+42
| | | | | | - use CancelIoEx when available - handle pending Overlapped / extra data - move windows version to compat
* r135: stopped modifying errno if succeeded.r135Michael Plante2010-02-021-7/+11
|
* r134: fixed some silly /W3 warnings in MSVCr134Michael Plante2010-02-021-4/+4
|
* r133: fixed missing LONG_PTR reference using intptr_t instead since that's ↵r133Michael Plante2010-02-021-1/+1
| | | | in one of our headers
* r132: harmonized compatibility layer function names (_libusb prefix always, ↵r132Pete Batard2010-02-023-44/+44
| | | | | | rather than _for_poll suffix) additional minor xusb improvements.
* r130: fixed *size in HidD_GetPhysicalDescriptor and fixed various /W4 ↵Pete Batard2010-02-013-22/+35
| | | | warnings for MSVC (windows files)
* r128: additional cygwin fixes for concurrencyPete Batard2010-01-302-2/+4
|
* r127: merged concurrency branch with master (native improved concurrency ↵Pete Batard2010-01-303-216/+441
| | | | | | | | | | | | | | | | | | | | | | | | handling for Windows files) [c119->c137]: c119: concurrency handling: - use semaphore in init/exit (Orin Eman) - use separate thread for timer and remove the need for affinity restoration - minor code readability improvements (moved GUIDs to .h) c120: removed unneeded disabling of APIs in winusb_exit & hid_exit c121: changed CreateThread to _beginthreadex, so CRT works properly when mem is low (Michael Plante) c122: made name of named-semaphore unique across the system per-process (Michael Plante) c123: allow timer thread to quit gracefully, and cleanup many of the handles (Michael Plante) c124: fixed concurrent_usage if init fails (Michael Plante) c125: drop PulseEvent in timer thread and use semaphore for response (Orin Eman). c126: removed pthread dependency in windows_compat.c c127: fixed missing reset of timer_request when event has already been handled c128: additional fixes for timer thread: - closed timer_mutex handles, and fixed volatile warning regarding interlocked ops (Michael Plante) - missing ResetEvent and possible missing request handling fix (Orin Eman) - additional fixes c129: use of spinlocks and critical sections in windows_compat.c for mutexes (Orin Eman, Michael Plante) c130: fixed missing spinlock in exit_polling c131: made spinlock static, changed to LONG, and casted off volatile in InterlockedExchange calls (Michael Plante) c132: additional security checks when entering critical sections in windows_compat.c c133: brought latest master commits to the concurrency branch [r119 -> r122] c134: fixed unfortunate inverted comparison introduced in c132 c135: fixed timer thread warnings with MinGW c136: brought latest master commits to the concurrency branch [r123 -> r126] c137: removed pthread.h and sched.h includes from windows_usb.c
* r123: reverted the use of usb_interface in core and forced interface to be ↵Pete Batard2010-01-291-14/+6
| | | | undefined always on Windows
* r122: fixed poll conflict on cygwin (all compat functions renamed to ↵Pete Batard2010-01-283-15/+12
| | | | | | | _libusb_####) - fixed sscanf_s undefined for non MS compilers - fixed cygiwn warnings in windows_usb.c
* r114: sources update and build script (Orin Eman)Pete Batard2010-01-253-18/+19
| | | | | OACR 28719 warning removal (Orin Eman) minor code cleanup
* r113: HID part 4 (feature complete) + rc file copyright update (Peter Stuge)Pete Batard2010-01-252-25/+175
|
* r105: added MS Sidewinder HID test in xusb.c + minor changes/improvementsPete Batard2010-01-232-5/+9
|
* r104: thread safety change for pipe_number globalMichael Plante2010-01-231-2/+5
| | | | Signed-off-by: Michael Plante <michael.plante@gmail.com>
* r103: HID part 3 (WIP)Pete Batard2010-01-222-369/+485
| | | | | | | | - get_interface_details() now has an optional SP_DEVINFO_DATA parameter - usbi_handle_transfer_cancellation() now called from windows_cancel_transfer() - set_report/get_report (WIP) and improved HID support functions - better support for sync I/O in hid_submit_control_transfer - hid_abort_transfers
* r99: DDK/sources x64 final fix and additional MSVC fixes (/MT)Pete Batard2010-01-211-1/+1
|
* r98: additional MSVC6 fixesPete Batard2010-01-212-1/+7
|
* r97: minor fixes for cygwin and sourcesPete Batard2010-01-213-7/+6
|
* r96: added sources support (Orin Eman)Pete Batard2010-01-214-5/+68
|
* r94: removed the need for DDK includes + minor fixesPete Batard2010-01-212-93/+284
|
* r93: HID part 2 (WIP)Pete Batard2010-01-204-104/+796
| | | | | | | | | | - added composite HID device support in xusb.c - fixed signed/unsigned bug in windows_compat.c (Orin Eman) - added support for synchronous completion of async requests - composite HID device support (ClassGUID fallback for driver unavail., read interface number from MI_##, extra path for HID) - generic interface_by_endpoint and get_valid_interface - added HID struct in priv - HID submit_control_transfer