382 Commits

Author SHA1 Message Date
Pete Batard cef2f9790f fixed continuous polling during timeout (Graeme Gill) c194 2010-03-11 18:09:42 +00:00
Pete Batard e6a00b7604 residuals from previous merge c193 2010-03-10 23:53:39 +00:00
Pete Batard 409d6d2c58 moved usbi_fd_notification call after usbi_add_pollfd 2010-03-10 23:38:32 +00:00
Pete Batard ff45b74423 residuals from previous merge c192 2010-03-10 13:25:30 +00:00
Pete Batard ea78e1ce73 merge up to r202 c191 2010-03-10 13:19:38 +00:00
Pete Batard fae9c17bd2 libusb0.sys backend integration - part 2 (Graeme Gill) c190 2010-03-10 13:14:51 +00:00
Pete Batard 4ee3179ae1 libusb0.sys backend integration - part 1 (Graeme Gill) c189 2010-03-08 12:36:26 +00:00
Pete Batard ad460bca72 dynamically load Cfgmgr32.dll exports (Graeme Gill) r188 2010-03-03 20:17:15 +00:00
Pete Batard 6320efeb75 changed calling convention to __stdcall (VS2008) 2010-03-03 16:41:35 +00:00
Pete Batard 9ac1a90bdf added msvc/config.h inclusion error for MinGW/cygwin r187 2010-03-03 02:56:27 +00:00
Pete Batard b25d4fd10c better fix for poll_dbg and MSVC6 r186 2010-03-02 20:46:46 +00:00
Pete Batard f20223074c removed poll_dbg to keep MSVC6 users happy r185 2010-03-02 20:34:35 +00:00
Pete Batard efee8c0871 fixed cygwin warning with poll_dbg r184 2010-03-02 16:18:27 +00:00
Pete Batard 32f130a540 renamed windows_compat to poll_windows 2010-03-02 16:13:33 +00:00
Pete Batard 35d428fd02 renamed unistd_posix.h to poll_posix.h 2010-03-02 15:57:46 +00:00
Pete Batard 4c38f2bef9 fixed MinGW warnings 2010-03-02 15:53:43 +00:00
Pete Batard 12f7a5344e poll fd notification improvements (windows poll layer)
call usbi_fd_notification on new fd
also improves DYNAMIC_FDS option
2010-03-02 15:41:07 +00:00
Pete Batard 4637f267b0 poll fd notification improvements (core)
factorized code from libusb_open into new function usbi_fd_notification
2010-03-02 15:39:01 +00:00
Pete Batard 4072ec828c use usbi logging facility in poll layer 2010-03-01 18:19:50 +00:00
Pete Batard 1c72741123 reattach driver when detached in xusb (Xiaofan Chen) r183 2010-03-01 16:43:48 +00:00
Pete Batard 158799ca3f xusb improvements for HID test: int. vs bulk (Xiaofan Chen) r182 2010-03-01 16:08:20 +00:00
Pete Batard a3e487f1b9 xusb improvements and fixes r181 2010-02-28 22:31:06 +00:00
Pete Batard f7c451a30c fixed issue with DYNAMIC_FDS (Jere Knaappila) r180 2010-02-26 13:22:09 +00:00
Pete Batard bdeed5cbbb fixed a typo in usbi_mutex_unlock
also added mutex release in libusb_unref_device
r179
2010-02-26 01:39:11 +00:00
Pete Batard fceedd4d30 fixed missing brackets that prevented DYNAMIC_FDS from working properly r178 2010-02-25 22:45:55 +00:00
Pete Batard cd5200d62b fixed small issue when HID get feature is not available r177 2010-02-25 20:25:54 +00:00
Pete Batard 778360b4e9 added nonbuffered stdio logging option in compatibility layer r176 2010-02-25 19:36:27 +00:00
Pete Batard b4859ac74c added fd detection update option in usbi_poll()
when DYNAMIC_FDS is enabled, poll returns with EINTR when fds are modified
2010-02-25 19:33:18 +00:00
Pete Batard f2297884fa reverts some of the changes from dbd439/6c7a1e (r173) r175 2010-02-24 23:04:03 +00:00
Pete Batard 2745941df4 exclude dpfp_threaded if pthread is not available (MinGW) r174 2010-02-24 22:18:41 +00:00
Pete Batard 6c7a1e0ca4 includes simplification and cleanup (os) r173 2010-02-24 22:06:18 +00:00
Pete Batard dbd439fa2c includes simplification and cleanup (core) 2010-02-24 22:05:40 +00:00
Pete Batard 0a40fde82d renamed _libusb_ unistd calls to usbi_ r172 2010-02-24 19:04:06 +00:00
Pete Batard 921572e90b added unistd_posix.h r171 2010-02-24 18:05:11 +00:00
Pete Batard e49877a0bf moved standard calls redefinitions into a separate .h
This applies to read/write/close/poll/pipe -> unistd_posix.h
2010-02-24 17:51:05 +00:00
Pete Batard 8d4f2913ba fixed obsolete config_msvc.h and pthread-win32 references
also cleaned up msvc/config.h
r170
2010-02-24 16:36:48 +00:00
Pete Batard c83b94c78f merge abstraction for POSIX Threads and integration changes (Michael Plante, 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
r169
2010-02-24 11:29:43 +00:00
Pete Batard 1d8a2cc6ae improved HID feature reports r168 2010-02-22 16:45:18 +00:00
Pete Batard 71c795ca20 updated copyright notice and credits in source r167 2010-02-20 01:16:20 +00:00
Pete Batard 2e83188d9c added detection of uninitialized devices on open r166 2010-02-19 17:16:41 +00:00
Pete Batard 3a42fe7e65 fixed cygwin warning r165 2010-02-19 01:34:07 +00:00
Pete Batard 87b577fda7 fixed improper parent when reusing device + cosmetics fixes r164 2010-02-18 21:07:19 +00:00
Pete Batard 5276f2ab66 revert r102/f0d352: handle_timeouts() CORE modification r163 2010-02-18 00:55:07 +00:00
Pete Batard 60412cb33f xusb improvements (feature reports) r162 2010-02-18 00:22:50 +00:00
Pete Batard bd03584493 ERROR_SEM_TIMEOUT + FORCE_INSTANT_TIMEOUTS for cancellation
added ERROR_SEM_TIMEOUT case in windows_transfer_callback,
FORCE_INSTANT_TIMEOUTS compilation option + uint8_t fix for ddk_build
r161
2010-02-18 00:14:23 +00:00
Pete Batard c01d1df73c fixed HID feature reports r160 2010-02-17 23:25:12 +00:00
Pete Batard 857f2f9267 improved windows_set_configuration r159 2010-02-17 20:36:27 +00:00
Pete Batard 72cd345907 removed unofficial versioning from comments r158 2010-02-17 17:56:19 +00:00
Pete Batard 5427675261 fixed aggressive transfer cancellation r157 2010-02-17 16:28:52 +00:00
Pete Batard 00d87387ec revert back to call copy_transfer_data always in callback
previous change there was unnecessary and actually messed up control transfers
r156
2010-02-16 22:20:17 +00:00