This is my 'policy' fork of libusbx (originally it was a fork of
libusb). I had not originally planned to submit this code back to libusb, but
as the pace of development work on libusbx is so much faster than on libusb,
I'm finding maintaining a fork to be major pain, so I've done a bunch
of code clean up, and am submitting the result.
This fork was created for my work with drivers that need USB support. These
drivers often need custom memory allocators and/or custom logging systems, and
so I added an extra 'policy' option to libusb_init and called the
result libusb_init_full. A policy structure is intended to be a simple
interface to specify alternative logging and/or memory allocation methods on a
per-context basis. It could easily be expanded to provide policies for other
facilities, if needed.
My original hope had been that the introduction of libusb_init_full would be
the only major API change, but it turns out there are numerous places where
convenient structure-allocation functions are provided, and they all had to be
modified so they could know which allocator they were using.
I tried to ensure that my code would compile under Android as well as Linux,
but I have no access to a Windows development environment, and so decided not
to touch Windows-specific files. As a result this branch definitely breaks
Windows support.
I don't actually expect this branch to be accepted without major work, as I
had to make a number of design decisions while working on this that are not
necessarily going to be the same as those the main developers would make.
However, I am willing to put in the effort to be able to merge this fork with
back with the original.
I look forward to your feedback.
You can merge this Pull Request by running:
git pull https://github.com/swestrup/libusbx policy
Or you can view, comment on it, or merge it online at:
https://github.com/libusbx/libusbx/pull/128
-- Commit Summary --
* Patched with
'0001-Linux-Fix-70-race-condition-insysfs_get_device_list.patch'
* Windows: Don't use a log function body macro for old MS compilers
* Windows: Fix build on VC++2003 which doesn't support variadic macros
* Updated CFLAGS for easier valgrind debugging
* OpenBSD: Fix warning: 'hpriv' may be used uninitialized
* examples: Use snprintf() instead of sprintf() in dpfp and dpfp_threaded
* Linux: Silence unused variable warnings when without CLOCK_MONOTONIC
* configure.ac: Separate per-OS backend selection from per-backend settings
* Experimental support for NetBSD using the OpenBSD backend
* io.c: Add debug message with the callback address on completed transfer
* libusb-1.0.pc: Mention OpenBSD and NetBSD in description
* Linux: Fix cancel_transfer return value when cancelling a multi-urb transfer
* Don't print an error when libusb_cancel_transfer() fails with NOT_FOUND
* Linux: Fix URB return code handling
* Linux: Translate isoc packet status codes to LIBUSB_TRANSFER_ codes
* Linux: Remove bogus status handling from handle_iso_completion()
* Linux: Fix a comment in handle_iso_completion()
* Windows: Bring .vcproj x86_64 output directories in line with x86_32
* configure.ac: LT_LANG([Windows Resource]) makes windres check redundant
* Windows: fix Clang warnings about unused assignations
* .gitattributes: Add export-ignore for .gitattributs and .gitignore
* Linux: Don't spam the console with 'device unconfigured' errors
* Darwin: Silence warning: cast from pointer to integer of different size
* Makefile.am: Fix msvc dir not being included in make dist
* libusb/Makefile.am: Fix missing DLL .def file from make dist
* Windows: Rename VS2005 solution and add VS2010 project files
* Add libusb_get_version() API function
* Windows: Base DUMMY_HANDLE on LONG_PTR instead of LONG
* Windows: Prefer calloc() over malloc() and cast all allocations
* Windows: Silence warning about unused function guid_to_string()
* Windows: Add textual error name to debug message on auto-release errors
* Windows: Warn on one libusb_get_device_list() memory allocation failure
* Windows: Remove #define compile time options in the backend source code
* OpenBSD: Provide libusb_get_device_speed() data
* doc/Makefile.am: Remove username from SF web rsync upload command
* Include library version in the very first libusb_init() debug message
* Add a timestamp in log messages
* Linux: Search for /dev/usbdev<bus>.<device> USB device special
files
* AUTHORS: Update Pete Batard's copyright years and email address
* README: Add the BSDs, punctuation, mailinglist link, and remove Daniel
* AUTHORS: Add Peter Stuge as copyright holder
* AUTHORS: Add Hans de Goede as copyright holder
* AUTHORS: Add Martin Pieuchot as copyright holder
* AUTHORS: Update list of contributors
* libusb-1.0.9
* AUTHORS: Update Nathan Hjelm's copyright years
* Updated gitignore to ignore doxygen.cfg
* Fixed debug logging to work in a logical way
* Made a patch from my logging changes
* Fixed my debug changes to match documentation
* Linux: Fix warning: comparison between signed and unsigned
* manual merge -- doesn't compile yet
* It all compiles again
* Windows: Make new transfers correctly notify the event handling thread
* examples: Use a common LDADD for all examples
* .gitignore: Add examples/ path to the examples
* examples: Only check for HAVE_SIGACTION once in Makefile.am
* examples: Add sam3u_benchmark isochronous example by Harald Welte
* Added debug output for tracking events_lock
* Fixed bugs in last update
* Bumped RC version for internal use
* Merged libusb-1.0 debian directory from 1.0.6-1
* Use debian source format 3.0 (git)
* Disable AM_MAINTAINER_MODE to allow for auto-regeneration of *.in &
configure, if *.ac happen to change
* Committed autoreconf (2.65-3ubuntu1) toolchain
* Do not treat ChangeLog as phony target (corrects for "make
distcheck" failure)
* Keep config.sub, config.guess alive from persistent autoreconf toolchain
* Add deb package build script to use debuild
* Gitignore normal debuild'd output (which gets debclean'd anyway)
* Testing...
* Revert "Committed autoreconf (2.65-3ubuntu1) toolchain"
* Removed Toolchain from repo
* Committing libtool 2.2.6b toolchain
* Adding only autoreconf toolchain
* Simplified .gitignore to understand what makes a 100% clean source tree
* Merge branch 'debianization' of
ssh://git.userful.ca/git-userful/libusb-1.0 into debianization
* Revert "Adding only autoreconf toolchain"
* Revert "Committing libtool 2.2.6b toolchain"
* Sanatized autogen.sh and .gitignore for a prestine environment
* Allow debuild to auto-run libtool/autoreconf
* Merge branch 'debianization' of
git.userful.ca:/git-userful/libusb-1.0 into debianization
* Minor fixup of build-deb.sh
* Ignore INSTALL mods, just incase there is a drift in local libtooling and
autoreconfing
* Fixed a broken symlink caused by an incremented shared-object minor version
number
* Clean up broken whitespace in list_for_each_entry() macros
* Windows: Fix deadlock when submitting transfers
* autogen.sh: Exit script on first error
* autogen.sh: Correctly pass arguments containing spaces to configure
* Core: Return LIBUSB_ERROR_IO on sync API TRANSFER_ERROR and _CANCELLED
* Darwin: Fix warning: comparison between signed and unsigned
* io.c: Only disarm timerfd when no flying transfer has a timeout
* examples/Makefile.am: Use the implicit _SOURCES rule
* Windows: Add INSTALL_WIN.txt
* .gitattributes: Set INSTALL_WIN.txt eol=crlf attribute
* io.c: Avoid timerfd race condition between completion and new submit
* Windows: Stop leaking event handle when destroying condition variables
* libusb.h: Fix #145 libusb_ref_device() and libusb_unref_device() typos
* Windows: Remove msvc/inttypes.h
* Windows: #include <windows.h> in header files
* INSTALL_WIN.txt: Correct Windows backend webpage URL
* io.c: Handle >= 1 second transfer timeout in libusb_submit_transfer()
* io.c: Handle >= 1 second transfer timeout in libusb_wait_for_event()
* configure.ac: Use LIBS instead of PC_LIBS_PRIVATE
* configure.ac: Move THREAD_CFLAGS into AM_CFLAGS
* configure.ac: Move VISIBILITY_CFLAGS into AM_CFLAGS
* configure.ac: AC_SEARCH_LIBS(clock_gettime) to be able to add -pthread
* Merged debianization into master
* Merged with upstream
* Merged with updated debug system
* Merge branch 'master' into userful
* Merged Userful and latest Master branches
* Fixed a few bugs in the new debug system
* Attempted to merge userful libusb debug system into libusbx...
* Initial add of allocator and logger definitions from another project
* Making the allocator.h function fit the libusb conventions.
* Putting in a new allocator is more work than I had hoped
* logging is mostly written now
* LOTS of API changes. :-( Not happy about that.
* linux version compiles again, but we don't link...
* almost all of the allocator stuff is in
* allocation finished, now to finish writing the logger
* minor update
* Merged with latest upstream
* Updated merged code to compile again
* Most of the logging functions are now in
* All the logging and allocation indirection code is in, now to debug...
* We now pass tests/stress
* Fixed how errors and warnings appear in debug output
* Merge branch 'master' of ssh://github.com/swestrup/libusbx into
sti_libusbx
-- File Changes --
M .gitattributes (20)
M .gitignore (32)
M INSTALL (206)
A RELEASE-NOTES (35)
M autogen.sh (1)
A build-deb.sh (26)
M configure.ac (5)
A debian/changelog (666)
A debian/compat (1)
A debian/control (36)
A debian/copyright (29)
A debian/libusb-1.0-0-dev.doc-base (16)
A debian/libusb-1.0-0-dev.docs (3)
A debian/libusb-1.0-0-dev.install (5)
A debian/libusb-1.0-0-udeb.install (1)
A debian/libusb-1.0-0.docs (1)
A debian/libusb-1.0-0.install (2)
A debian/rules (201)
A debian/source/format (1)
M examples/dpfp.c (6)
M examples/dpfp_threaded.c (6)
M examples/sam3u_benchmark.c (2)
M examples/xusb.c (12)
M libusb/Makefile.am (5)
A libusb/allocator.c (248)
A libusb/allocator.h (227)
A libusb/allocatori.h (372)
M libusb/core.c (386)
M libusb/descriptor.c (219)
M libusb/hotplug.c (9)
M libusb/io.c (132)
M libusb/libusb.h (129)
M libusb/libusbi.h (168)
A libusb/logger.c (428)
A libusb/logger.h (198)
A libusb/loggeri.h (219)
M libusb/os/darwin_usb.c (222)
M libusb/os/linux_udev.c (44)
M libusb/os/linux_usbfs.c (280)
M libusb/os/linux_usbfs.h (10)
M libusb/os/poll_posix.c (7)
M libusb/os/poll_posix.h (2)
M libusb/os/poll_windows.c (6)
M libusb/os/poll_windows.h (2)
M libusb/os/threads_windows.h (2)
M libusb/os/windows_usb.c (27)
M libusb/sync.c (22)
M libusb/version.h (2)
D msvc/inttypes.h (295)
A msvc/libusb_dll.vcxproj (166)
A msvc/libusb_dll.vcxproj.filters (69)
A msvc/libusb_static.vcxproj (150)
A msvc/libusb_static.vcxproj.filters (56)
A msvc/libusb_vs2010.sln (49)
A msvc/listdevs.vcxproj (165)
A msvc/listdevs.vcxproj.filters (14)
-- Patch Links --
https://github.com/libusbx/libusbx/pull/128.patch
https://github.com/libusbx/libusbx/pull/128.diff
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel