aboutsummaryrefslogtreecommitdiff
path: root/lib/libusb/libusb10.h
Commit message (Collapse)AuthorAgeFilesLines
* libusb: implement libusb_setlocale to support different locale of error messageShengYi Hung2025-07-111-0/+6
| | | | | | | | | | | | | | | Upstream libusb identifies languages using only the first two characters of the language code. We adopt the same approach to maintain API compatibility. Currently, only English and Mandarin are supported, as other languages are not yet implemented. Reviewed by: kevans Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50820
* libusb: replace LOG_LEVEL with DEBUG_LEVELShengYi Hung2025-07-091-18/+6
| | | | | | | | | | | | | | | | | | | | | The libusb set debug level by libusb_log_level instead of libusb_debug_level. We switch to libusb_log_level for better compatibility with the upstream libusb. Additionally, The upstream libusb has an option allows user to override the log function with a user-defined callback. To support the callback function with a single string without va_arg, we refactor the log facility as a function instead of a macro and parse all va_args inside. The legacy debug_level enum has been removed to enforce maintainer migrate from their deprecated source code. Reviewed by: kevans Approved by: markj (mentor), lwhsu (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50680
* libusb: implement `libusb_get_parent`Aymeric Wibo2025-06-121-0/+1
| | | | | | | | | | | Newer versions of drivers such as libwacom (graphics tablets) or libfprint (fingerprint scanners) call g_usb_device_get_parent. This in turn calls libusb_get_parent on platforms which implement it, and returns NULL on platforms that don't. This patch implements this function on FreeBSD. Reviewed by: bapt, kevans Differential Revision: https://reviews.freebsd.org/D46992
* libusb: use eventfdBaptiste Daroussin2025-05-151-1/+1
| | | | | | | | | Simplify libusb code by replacing pipe(2) inter thread event mecanism with eventfd(2). MFC After: 3 weeks Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D50360
* libusb: hotplug, use events instead of a timer when possibleBaptiste Daroussin2025-01-161-0/+16
| | | | | | | | | | | | | Try to fetch events from nlsysevent or devd to determine when to scan the usb bus for devices addition or removal. if none are available fallback on the regular timer based (4s) scanner if devd socket or netlink socket is closed or error fallback on the timer based method. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D48300
* Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-161-1/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* Fix support for LIBUSB_HOTPLUG_ENUMERATE in libusb. Currently allHans Petter Selasky2019-06-261-1/+3
| | | | | | | | | | | | 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
* Improve LibUSB debugging by simultaneously allowing both functionHans Petter Selasky2018-09-141-16/+18
| | | | | | | | | | | | | | 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-121-0/+3
| | | | | | | | | | | | | | | | | | 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
* lib: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-261-0/+2
| | | | | | | | | | | | | | | 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
* Resolve issue with libusb C++ header file inclusion.Hans Petter Selasky2016-06-241-3/+3
| | | | | | | | | 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-231-0/+1
| | | | | | | | | | | 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-221-0/+18
| | | | | | | | | | | | 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
* - Make the FreeBSD's USB library compile under Linux.Hans Petter Selasky2013-03-131-0/+2
| | | | | | | | | | - Fix a compile warning where the return value of a call to a write() function was ignored. - Remove redundant include files from userland USB header files. - Add some now needed include files to various C-files. Notes: svn path=/head/; revision=248236
* Sync to P4Andrew Thompson2009-11-201-1/+3
| | | | | | | | | | | | - fix a transfer cancelling bug/segfault [1] - correct a return code in the transfer cancel function. - add new API function, libusb20_tr_bulk_intr_sync(). Submitted by: HPS Reported by: Robert Jenssen [1] Notes: svn path=/head/; revision=199575
* LibUSB v1.0:Alfred Perlstein2009-07-301-38/+81
| | | | | | | | | | | | - Significantly improve libusb10 support. - Many minor issues fixed. - P4 ID: 166189, 165853, 165991, 166052, 166069 Submitted by: hps Approved by: re Notes: svn path=/head/; revision=195957
* Sync the libusb 1.0 exported api to the latest GSoC code.Andrew Thompson2009-07-101-194/+19
| | | | | | | | | | | | | - Fix possible uninitialised variables and null derefs - Support big transfers - Various bug fixes and style changes Submitted by: Sylvestre Gallon Sponsored by: Google Summer of Code 2009 Approved by: re (kib) Notes: svn path=/head/; revision=195560
* Add files missed in r194674.Andrew Thompson2009-06-231-0/+245
Add libusb 1.0 support which is compatible with the latest revision on Sourceforge. Libusb 1.0 is a portable usb api released December 2008 and supersedes the original libusb released 10 years ago, it supports isochronous endpoints and asynchronous I/O. Many applications have already started using the interfaces. This has been developed as part of Google Summer of Code this year by Sylvestre Gallon and has been cribbed early due to it being desirable in FreeBSD 8.0 Submitted by: Sylvestre Gallon Sponsored by: Google Summer of Code 2009 Reviewed by: Hans Petter Selasky Notes: svn path=/head/; revision=194676