104 Commits

Author SHA1 Message Date
Pete Batard fc2b212758 better handling of attach/detach for Linux in xusb.c 2010-04-16 10:47:37 +01:00
Tim Roberts 32a674508a added more explicit library dependencies in xusb.c (MSVC) 2010-04-16 10:27:33 +01:00
Pete Batard 9300883d04 set default messaging level to warnings in xusb 2010-04-08 13:30:17 +01:00
Pete Batard 31aff02b62 fixed "ignoring return value of 'fwrite'" warning with gcc 2010-04-08 12:40:54 +01:00
Pete Batard c1cea1b0fe addressed MSVC warnings prompted by previous change 2010-04-08 12:33:27 +01:00
Pete Batard e295c065f3 added binary dump option to xusb (-b)
also switched boolean variables to actual bool
2010-04-08 12:30:06 +01:00
Pete Batard 2ec0c2b1ff fixed HID record size computation in xusb 2010-04-08 11:48:58 +01:00
Pete Batard adc0945982 fixed arglen warning from previous commit 2010-04-06 20:21:45 +01:00
Pete Batard b52b131343 xusb improvements (parameter handling + debug enable) 2010-04-06 20:20:01 +01:00
Michael Plante e5a9ce5865 xusb HID test improvements (Feature Reports)
Issue reported by Axel Rohde
2010-04-06 17:26:09 +01:00
Pete Batard 99587b5e2d ddk_build improvements (DLL option, static lib default) 2010-03-29 15:41:22 +01:00
Pete Batard fb787f4e67 enabled reuse of windows_error_str for wdi
additional cleanup
2010-03-23 19:42:15 +00:00
Pete Batard e36b809e53 renamed 2005 and 2008 MSVC solution files
2005 will be used a master and the only one included in release.
2008 will be kept in the development tree only for convenience.
2010-03-19 11:43:14 +00:00
Peter Stuge f43d8e65db removed trailing whitespaces (Windows backend) 2010-03-18 12:44:55 +00:00
Pete Batard e23692f3ea _stdcall calling convention for VS2005 DLL project files
also keeps default calling convention for non DLL project files with VS2008
2010-03-08 20:26:30 +00:00
Pete Batard 19f97761a0 xusb improvements (parameters checks) 2010-03-08 20:14:05 +00:00
Pete Batard 666106e836 more residual cleanup (Michael Plante) 2010-03-03 20:36:46 +00:00
Pete Batard 6320efeb75 changed calling convention to __stdcall (VS2008) 2010-03-03 16:41:35 +00:00
Pete Batard 32f130a540 renamed windows_compat to poll_windows 2010-03-02 16:13:33 +00:00
Pete Batard 1c72741123 reattach driver when detached in xusb (Xiaofan Chen) 2010-03-01 16:43:48 +00:00
Pete Batard 158799ca3f xusb improvements for HID test: int. vs bulk (Xiaofan Chen) 2010-03-01 16:08:20 +00:00
Pete Batard a3e487f1b9 xusb improvements and fixes 2010-02-28 22:31:06 +00:00
Pete Batard 2745941df4 exclude dpfp_threaded if pthread is not available (MinGW) 2010-02-24 22:18:41 +00:00
Pete Batard dbd439fa2c includes simplification and cleanup (core) 2010-02-24 22:05:40 +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
2010-02-24 11:29:43 +00:00
Pete Batard 71c795ca20 updated copyright notice and credits in source 2010-02-20 01:16:20 +00:00
Pete Batard 60412cb33f xusb improvements (feature reports) 2010-02-18 00:22:50 +00:00
Pete Batard dbd8c6a375 r141: HID I/O Overhaul:
- 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
2010-02-06 14:56:34 +00:00
Pete Batard 3bb808f398 r132: harmonized compatibility layer function names (_libusb prefix always, rather than _for_poll suffix)
additional minor xusb improvements.
2010-02-02 19:42:27 +00:00
Pete Batard 3e258645f4 r129: xusb fixes for Mass Storage test (Alan Stern):
- forces command length to 31
- null termination of vid/pid/rev strings
- big endian detection
2010-01-31 03:36:45 +00:00
Pete Batard c1f00180ff r126: fixed sscanf_s test for MSVC6 users 2010-01-30 21:00:23 +00:00
Pete Batard bf4f54160c r124: removes #error on previous commit and fixes thing ourselves 2010-01-30 01:40:41 +00:00
Pete Batard afe70cedf7 r123: reverted the use of usb_interface in core and forced interface to be undefined always on Windows 2010-01-29 20:04:35 +00:00
Pete Batard 47c83183c0 r122: fixed poll conflict on cygwin (all compat functions renamed to _libusb_####)
- fixed sscanf_s undefined for non MS compilers
- fixed cygiwn warnings in windows_usb.c
2010-01-28 23:18:52 +00:00
Pete Batard 37b685c355 r121: some more small improvements for xusb.c (vid:pid as cmdline parameter) 2010-01-28 15:56:04 +00:00
Pete Batard c69d51d779 r120: vc2005 express fixes (Orin Eman) 2010-01-28 13:32:38 +00:00
Pete Batard 388620e21f r119: xusb improvements for mass storage (Alan Stern) 2010-01-27 21:23:31 +00:00
Pete Batard fa2f3231db r118: more readable xusb output and added automated endpoint generation for Mass Storage 2010-01-26 15:32:57 +00:00
Pete Batard 03265db68a r116: DDK build completion (Orin Eman):
- lsusb/xusb sources + ddk_build call
- missing libusb_strerror in .def
- removed "handle_timeouts_locked unused" warning in in io.c for MinGW
2010-01-26 01:46:17 +00:00
Pete Batard 9459dd37f0 r115: added libusb_strerror (Francesco Montorsi) 2010-01-25 22:21:31 +00:00
Pete Batard 628bd43bc2 r105: added MS Sidewinder HID test in xusb.c + minor changes/improvements 2010-01-23 23:28:55 +00:00
Pete Batard 72c4defd45 r101: MSVC6 & VS 2005 updates (Michael Plante & Orin Eman) 2010-01-21 20:01:45 +00:00
Pete Batard dba186a53d r100: added MSVC6 project files (Michael Plante) 2010-01-21 18:40:19 +00:00
Pete Batard 5e98c8b1a3 r99: DDK/sources x64 final fix and additional MSVC fixes (/MT) 2010-01-21 17:38:43 +00:00
Pete Batard 0fc4348172 r94: removed the need for DDK includes + minor fixes 2010-01-21 01:34:53 +00:00
Pete Batard 5590301e7f r93: HID part 2 (WIP)
- 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
2010-01-20 20:29:45 +00:00
Pete Batard e158221159 r90: more compilation environment fixes:
- added Visual Studio 2005 (MSVC8) solution and project files (Orin Eman)
- renamed VS 2008 solution and project files
- fixed "warning: undefined symbols not allowed" for MinGW/cygwin in configure.ac
2010-01-19 00:55:30 +00:00
Pete Batard 7a8f7d1826 r89: extended API support
- composite devices as a separate backend API
- mutidriver support in composite devices interface
- HID: device interface path, open/close (WIP)
- added HID test in xusb.c
- fixed Windows version and DDK support
- smaller fixes
2010-01-18 20:32:38 +00:00
Pete Batard a93cef02ff r85: fixed MSVC warnings for x64 and reverted ssize_t to int for libusb_get_device_list change introduced with r52. Added definition on ssize_t in libusb.h for MSVC platforms. 2010-01-16 01:20:45 +00:00
Pete Batard 5f46b891de r82: added x64 support for MSVC and finalized directory structure.
Also amended README_MSVC.txt to reflect a better setup for the required DDK directories
2010-01-15 20:59:54 +00:00