aboutsummaryrefslogtreecommitdiff
path: root/lib/libusb
Commit message (Collapse)AuthorAgeFilesLines
* Be bug compatible with other operating systems by allowing non-sequentialHans Petter Selasky2020-12-141-8/+12
| | | | | | | | | | | | | | | | | interface numbering for USB descriptors in userspace. Else certain USB control requests using the interface number, won't be recognized by the USB firmware. Refer to section 9.2.3 in the USB 2.0 specification: Interfaces are numbered from zero to one less than the number of concurrent interfaces supported by the configuration. PR: 251784 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=368632
* Fix a few mandoc issuesGordon Bergling2020-10-091-16/+19
| | | | | | | | | | - skipping paragraph macro: Pp after Sh - sections out of conventional order: Sh EXAMPLES - whitespace at end of input line - normalizing date format Notes: svn path=/head/; revision=366583
* libusb: improve compatibilityKyle Evans2020-06-094-1/+61
| | | | | | | | | | | | | | | | | | | Specifically, add LIBUSB_CLASS_PHYSICAL and the libusb_has_capability API. Descriptions and functionality for these derived from the documentation at [0]. The current set of capabilities are all supported by libusb. These were detected as missing after updating net/freerdp to 2.1.1, which attempted to use both. [0] http://libusb.sourceforge.net/api-1.0/group__libusb__misc.html Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25194 Notes: svn path=/head/; revision=361977
* Fix for building libusb under Linux.Hans Petter Selasky2020-03-101-0/+7
| | | | | | | | MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=358841
* Add missing mutex unlock in failure case.Hans Petter Selasky2020-01-301-1/+3
| | | | | | | | | | | | Differential Revision: https://reviews.freebsd.org/D23430 Submitted by: cem Reported by: Coverity Coverity CID: 1368773 MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=357298
* Implement new libusb v2.0 API function, libusb20_dev_get_stats().Hans Petter Selasky2019-12-276-2/+73
| | | | | | | | | | This function is useful when debugging USB device issues. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=356136
* Update Makefile.depend filesSimon J. Gerraty2019-12-111-1/+0
| | | | | | | | | | | | | Update a bunch of Makefile.depend files as a result of adding Makefile.depend.options files Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22494 Notes: svn path=/head/; revision=355617
* libusb: LIBUSB_DEBUG environment variable override of libusb_set_debugKyle Evans2019-10-021-4/+19
| | | | | | | | | | | | | | | | | | | | | The debug level generally just controls verbosity of libusb for debugging libusb devices/usage. We allow the environment to set the debug level independent of the application, but the application will always override this if it explicitly sets the debug level. Changing the environment is easy, but patching the software to change the debug level isn't necessarily easy or possible. Further, there's this write-only debug_fixed variable that would seem to imply that the debug level should be fixed, but it isn't currently used. Change the logic to use strtol() so we can detect real 0 vs. conversion failure, then honor debug_fixed in libusb_set_debug. Reviewed by: hselasky MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D21877 Notes: svn path=/head/; revision=353009
* pkgbase: Create a FreeBSD-utilities package and make it the default oneEmmanuel Vadot2019-09-051-1/+0
| | | | | | | | | | | | | The default package use to be FreeBSD-runtime but it should only contain binaries and libs enough to boot to single user and repair the system, it is also very handy to have a package that can be tranform to a small mfsroot. So create a new package named FreeBSD-utilities and make it the default one. Also move a few binaries and lib into this package when it make sense. Reviewed by: bapt, gjb Differential Revision: https://reviews.freebsd.org/D21506 Notes: svn path=/head/; revision=351858
* Only call libusb_hotplug_enumerate() once from ↵Hans Petter Selasky2019-06-261-3/+3
| | | | | | | | | | | | | libusb_hotplug_register_callback(). Else when registering multiple filters the same USB device may appear twice in the list. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=349410
* Fix support for LIBUSB_HOTPLUG_ENUMERATE in libusb. Currently allHans Petter Selasky2019-06-262-12/+25
| | | | | | | | | | | | devices are enumerated regardless of of the LIBUSB_HOTPLUG_ENUMERATE flag. Make sure when the flag is not specified no arrival events are generated for currently enumerated devices. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=349409
* Fix for reading the configuration descriptor in libusb. Catch invalidHans Petter Selasky2019-06-081-0/+8
| | | | | | | | | | | | configuration descriptor reads early on to avoid issues with devices that don't check for a valid USB configuration read request. Submitted by: takahiro.kurosawa@gmail.com PR: 238412 MFC after: 3 days Notes: svn path=/head/; revision=348797
* Fix typos in libusb.Hans Petter Selasky2019-03-051-2/+2
| | | | | | | | | Found by: Denis Ahrens <denis@h3q.com> MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=344795
* libusb(3): Update the link to the libusb homepage.Mateusz Piotrowski2018-10-111-7/+11
| | | | | | | | | | | While here, pet mandoc & igor. Reviewed by: bcr, hselasky Approved by: re (kib), krion (mentor, implicit), mat (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D17516 Notes: svn path=/head/; revision=339305
* When multiple threads are involved receiving completion events in LibUSBHans Petter Selasky2018-09-281-0/+6
| | | | | | | | | | | | | | | make sure there is always a master polling thread, by setting the "ctx_handler" field in the context. Else the reception of completion events can stop. This happens if event threads are created and destroyed during runtime. Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com> PR: 231742 MFC after: 1 week Approved by: re (kib) Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=338993
* Improve LibUSB debugging by simultaneously allowing both functionHans Petter Selasky2018-09-142-19/+36
| | | | | | | | | | | | | | and transfer prints. Make sure the debug level comes from the correct USB context. Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com> PR: 231264 MFC after: 1 week Approved by: re (kib) Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=338679
* Fix issues about cancelling USB transfers in LibUSB when the USB device hasHans Petter Selasky2018-09-123-43/+91
| | | | | | | | | | | | | | | | | | been detached. When a USB device has been detached the kernel file handle stops responding to commands. USB applications which continue to run after the USB device has been detached, depend on LibUSB generated events to tear down its pending USB transfers. Add code to handle the needed cleanup when processing the USB transfer(s) fails and prevent new USB transfer(s) from being submitted. Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com> PR: 231076 MFC after: 1 week Approved by: re (gjb) Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=338616
* Improve the userspace USB string reading function in LibUSB.Hans Petter Selasky2018-06-261-9/+12
| | | | | | | | | | | Some USB devices does not allow a partial descriptor readout. Found by: bz @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=335669
* Allow the libusb20_dev_get_port_path() function to be called when theHans Petter Selasky2018-03-233-21/+31
| | | | | | | | | | | USB device is closed. This fixes a compatibility issue with upstream libusb. Found by: romain@ MFC after: 1 week Notes: svn path=/head/; revision=331419
* lib: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2614-0/+28
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326219
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Update several more URLsEitan Adler2017-10-291-1/+1
| | | | | | | | - Primarily http -> https - Primarily FreeBSD project URLs Notes: svn path=/head/; revision=325096
* libusb(3): Expose device caps as libusb_bos_descriptor::dev_capabilityKyle Evans2017-08-092-2/+27
| | | | | | | | | | | | | | | | | | | Some libusb consumers in Linux-land (in this case, libusb4java) expect a dev_capability member that they can use to enumerate the device capabilities. No particular layout is expected of this, just that it can be traversed using the bLength member until bNumDeviceCapabilities are read and that the consumer may then use one of the libusb_get_*_descriptor methods to extract specific (usb 2.0 vs. ss) capability information. In collaboration with: hselasky Reviewed by: hselasky Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D11494 Notes: svn path=/head/; revision=322322
* Fix libusb20_dev_get_desc(3) to use the "vendor product" order, notEdward Tomasz Napierala2016-10-221-2/+2
| | | | | | | | | | | | | | "product vendor". This is consistent with how it's generally done. The ordering is visible eg in usbconfig(8) output. Note to self: MFC this to 9 and 8. Reviewed by: hselasky@ MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D8258 Notes: svn path=/head/; revision=307774
* Fix array size issue when using the pre-scaling feature forHans Petter Selasky2016-09-021-2/+13
| | | | | | | | | | | ISOCHRONOUS USB transfers. Make sure enough length and buffer pointers are allocated when setting up the libusb transfer structure to support the maximum number of frames the kernel can handle. MFC after: 1 week Notes: svn path=/head/; revision=305284
* Resolve issue with libusb C++ header file inclusion.Hans Petter Selasky2016-06-242-5/+5
| | | | | | | | | Approved by: re (marius) PR: 210509 MFC after: 1 week Notes: svn path=/head/; revision=302171
* Add support for USB streams to the LibUSB v1.0 API and update theHans Petter Selasky2016-06-236-2/+83
| | | | | | | | | | | libusb(3) manual page. Approved by: re (gjb) Requested by: swills MFC after: 1 week Notes: svn path=/head/; revision=302125
* Implement libusb_hotplug_register_callback() andHans Petter Selasky2016-06-226-1/+349
| | | | | | | | | | | | libusb_hotplug_deregister_callback() for the LibUSB v1.0 API and update the libusb(3) manual page. Approved by: re (kib) Requested by: swills MFC after: 1 week Notes: svn path=/head/; revision=302080
* Add missing return statement.Hans Petter Selasky2016-06-161-0/+1
| | | | | | | | Approved by: re (gjb) MFC after: 1 week Notes: svn path=/head/; revision=301969
* Add multiple missing descriptor parsing functions to the LibUSB v1.0 API.Hans Petter Selasky2016-06-164-2/+290
| | | | | | | | | Approved by: re (kib) Requested by: swills MFC after: 1 week Notes: svn path=/head/; revision=301968
* Add support for libusb_set_auto_detach_kernel_driver() to the LibUSB v1.0 API.Hans Petter Selasky2016-06-166-4/+47
| | | | | | | | | Approved by: re (kostikbel) Requested by: swills MFC after: 1 week Notes: svn path=/head/; revision=301966
* Add support for libusb_get_port_number() to the LibUSB v1.0 API.Hans Petter Selasky2016-06-163-1/+16
| | | | | | | | | Approved by: re (kostikbel) Requested by: swills MFC after: 1 week Notes: svn path=/head/; revision=301964
* Define LIBUSB_API_VERSION.Hans Petter Selasky2016-06-161-0/+2
| | | | | | | | | Approved by: re (kostikbel) Requested by: swills MFC after: 1 week Notes: svn path=/head/; revision=301957
* Implement libusb_get_version() and update libusb manual page.Hans Petter Selasky2016-06-164-1/+32
| | | | | | | | | Approved by: re (glebius) Requested by: swills MFC after: 1 week Notes: svn path=/head/; revision=301956
* Fix compile warning.Hans Petter Selasky2016-06-131-1/+1
| | | | | | | | Approved by: re (delphij) MFC after: 1 week Notes: svn path=/head/; revision=301846
* Implement code to stop all USB endpoints before executing a USB deviceHans Petter Selasky2016-06-121-2/+14
| | | | | | | | | | | | | reset command, alternate setting command or set configuration command. Else LibUSB v1.0 will not re-open the endpoints which the kernel closes and the USB application might wait infinitely for transfers to complete. Approved by: re (hrs) MFC after: 3 days Notes: svn path=/head/; revision=301842
* lib: minor spelling fixes in comments.Pedro F. Giffuni2016-05-011-1/+1
| | | | | | | No functional change. Notes: svn path=/head/; revision=298896
* MFHGlen Barber2016-04-111-2/+2
|\ | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=297824
| * USB: replace 0 with NULL for pointers.Pedro F. Giffuni2016-04-091-2/+2
| | | | | | | | | | | | | | | | | | Found with devel/coccinelle. Reviewed by: hselasky Notes: svn path=/head/; revision=297764
* | First pass through library packaging.Glen Barber2016-02-041-0/+1
|/ | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295278
* META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host.Bryan Drewery2015-11-251-1/+0
| | | | | | | | | | | This both avoids some dependencies on xinstall.host and allows bootstrapping on older releases to work due to lack of at least 'install -l' support. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=291307
* Remove redundant COMPAT_32BIT guard on pkgconfig files. This is already handledBryan Drewery2015-10-031-2/+2
| | | | | | | | | by the LIBRARIES_ONLY mechanism protecting FILES. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=288615
* Replace beforeinstall: handling with FILES.Bryan Drewery2015-09-181-10/+3
| | | | | | | | | This actually fixes some cases to respect LIBRARIES_ONLY. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=287980
* bsd.lib.mk has to be included after MLINKS assignmentAntoine Brodin2015-08-151-2/+2
| | | | Notes: svn path=/head/; revision=286812
* libusb: Fix minor cast-qual warning.Pedro F. Giffuni2015-07-201-5/+3
| | | | | | | | | | | | | Fix a warning triggered by the gcc + FORTIFY_SOURCE patches: In function 'libusb20_parse_config_desc': lib/libusb/libusb20_desc.c:141: warning: passing argument 1 of 'memcpy' discards qualifiers from pointer target type Submitted by: hselansky Notes: svn path=/head/; revision=285720
* Remove unused variables to silence CLANG warnings.Marcelo Araujo2015-06-242-14/+4
| | | | | | | | | | Remove some BLANK lines and unnecessary TABS. Differential Revision: D2687 Reviewed by: rodrigc, hselasky Notes: svn path=/head/; revision=284744
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-275-5/+12
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge from head@274682Simon J. Gerraty2014-11-192-0/+10
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=274683