Commit Graph

23 Commits

Author SHA1 Message Date
hselasky
37ff270164 Implement new libusb v2.0 API function, libusb20_dev_get_stats().
This function is useful when debugging USB device issues.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
2019-12-27 20:35:12 +00:00
hselasky
dae3c29923 Allow the libusb20_dev_get_port_path() function to be called when the
USB device is closed. This fixes a compatibility issue with upstream
libusb.

Found by:	romain@
MFC after:	1 week
2018-03-23 09:40:41 +00:00
pfg
260ba0bff1 lib: further adoption of SPDX licensing ID tags.
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.
2017-11-26 02:00:33 +00:00
trasz
dd66bf2b57 Fix libusb20_dev_get_desc(3) to use the "vendor product" order, not
"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
2016-10-22 14:37:13 +00:00
hselasky
d2f07e2fda Correct two comments. 2013-09-05 12:21:11 +00:00
hselasky
9ea6fe9fbe Add some missing definitions to build a working FreeBSD's libusb under Linux. 2013-07-14 10:22:00 +00:00
hselasky
b7fe9e8c88 Add new USB API to get the port path of a USB device.
MFC after:	2 weeks
Requested by:	emaste @
2013-05-03 07:44:58 +00:00
hselasky
0b8d792721 - Make the FreeBSD's USB library compile under Linux.
- 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.
2013-03-13 12:23:14 +00:00
hselasky
d7b1840a86 Add USB API to read power draw on USB devices.
Update usbconfig to print power draw on USB devices.

MFC after:	2 weeks
Submitted by:	Matt Burke @ icritical.com
2013-02-14 12:22:40 +00:00
hselasky
ac49f9f94c Add support for streams to LibUSB v2.0.
MFC after:	2 weeks
2012-08-13 18:10:52 +00:00
hselasky
3463f3d087 Fix some compile warnings.
MFC after:	1 week
2012-04-20 14:29:45 +00:00
hselasky
7549fd80dc - Add two new API's to libusb20 which can be used to retrive information
about the parent USB device:
  - libusb20_dev_get_parent_address
  - libusb20_dev_get_parent_port

- Rename libusb20_compat01.c into libusb01.c

MFC after:	3 days
2011-06-24 11:14:09 +00:00
hselasky
f6b78c32dc - Add support for software pre-scaling of ISOCHRONOUS transfers.
MFC after:	14 days
Approved by:	thompsa (mentor)
2011-02-28 17:23:15 +00:00
hselasky
1c90ef1274 - Add support for LibUSB in 32-bit compatibility mode.
Approved by:    thompsa (mentor)
2010-10-14 20:38:18 +00:00
wkoszek
8d96822e19 Resort includes to match style(9) a bit more. No functional change
is expected after this commit.

Tested by:	make buildworld
Reviewed by:	hps (patch without .h changes)
2010-02-13 09:45:50 +00:00
wkoszek
8c862cf5eb Remove redundand headers and use more standard ones where necessary.
Reviewed by:	hps@
2010-02-11 08:34:41 +00:00
thompsa
3aae590108 Add a function to check if the usb devices is still connected.
Submitted by:	Hans Petter Selasky
2010-01-29 02:44:06 +00:00
thompsa
aded7665d8 - fix refcounting error during data transfer
- fix a memory leak on the USB backend
- fix invalid pointer computations (in one case memory outside the allocated
  area was written in LibUSB v1.0)
- make sure memory is always initialised, also in failing cases
- add missing functions from v1.0.4

PR:		usb/140325
Reported by:	Robert Jenssen
Submitted by:	Hans Petter Selasky
MFC After:	3 days
2009-11-08 20:03:52 +00:00
thompsa
99b8f7ec7d Prevent wraparound of the timeout variable.
Submitted by:	HPS
2009-10-22 21:01:41 +00:00
thompsa
74c6c20b93 - Make struct usb_xfer opaque so that drivers can not access the internals
- Reduce the number of headers needed for a usb driver, the common case is just   usb.h and usbdi.h
2009-06-23 02:19:59 +00:00
thompsa
c9ef77f0ce Cleanup claim/release interface code, which is specific to libusb v0.1. Remove
claim and release interface support from libusb v2.0, because it is not useful.

Submitted by:	Hans Petter Selasky
2009-06-12 16:07:06 +00:00
thompsa
af6fb4f3d2 s/usb2_/usb_/ on all C structs for the USB stack. 2009-05-28 17:36:36 +00:00
thompsa
b95f7329df libusb20 is now installed as libusb, remove the version number from the
directory name.
2009-03-09 17:09:46 +00:00