Commit graph

17 commits

Author SHA1 Message Date
Andreas Kempe 230efeda08 libusbhid: add missing include guards
PR:		265136
2024-06-06 10:09:05 -04:00
Warner Losh b3e7694832 Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:16 -06:00
Warner Losh b61a573019 spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD
The SPDX folks have obsoleted the BSD-2-Clause-NetBSD 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
2023-05-12 10:44:04 -06:00
Pedro F. Giffuni 5e53a4f90f 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
Alexander Motin 7778ab7e0c MFprojects/hid:
Import the rest of HID improvements from the branch:
 - improve report descriptor parser in libusbhid to handle several kinds of
reports same time;
 - add to the libusbhid API two functions wrapping respective kernel IOCTLs
for reading and writing reports;
 - tune uhid IOCTL interface to allow reading and writing arbitrary report,
when multiple supported by the device;
 - teach usbhidctl to set output and feature reports;
 - make usbhidaction support all the same item names as bhidctl.

Sponsored by: iXsystems, inc.
2011-09-28 14:52:25 +00:00
Andrew Thompson ff7ad950be Use fixed width integer types for parsing the binary hid data.
PR:		usb/146367
Submitted by:	Hans Petter Selasky
2010-05-13 02:03:00 +00:00
Kai Wang cde587816c Merge improvements from kernel HID parser to the userland usbhid(3)
parser.  This merge does not change any API and should not break any
native or thirdparty applications.

Changes include:

* Merge multiple report ID support and other improvements from kernel
  HID parser.
* Ignore rid argument in hid_start_parser, parse all the report items since
  we now support multiple report ID.
* Skip report ID byte in hid_get_data() and set report ID byte in
  hid_set_data(), if report ID is non-zero.
* Reimplement hid_get_report_id: instead get report id from uhid device
  (which is always 0), try parsing the report descriptor and return the
  first report ID encountered.

Reviewed by:	hps
Silent on:	-usb mailing list
2010-03-27 08:00:16 +00:00
Alfred Perlstein 7e474656a6 src/usr.bin/usbhidaction/usbhidaction.c
src/usr.bin/usbhidctl/usbhid.c
src/sys/dev/usb2/include/usb2_hid.h
src/sys/dev/usb2/input/uhid2.c
src/lib/libusbhid/Makefile
src/lib/libusbhid/descr.c
src/lib/libusbhid/descr_compat.c
src/lib/libusbhid/usbhid.3
src/lib/libusbhid/usbhid.h
src/lib/libusbhid/usbvar.h

Patches to make libusbhid and HID userland utilities compatible with
the new USB stack. All HID ioctls should go through the libusbhid
library to ensure compatibility. I have found at least one piece of
software in /usr/ports which needs to get updated before USB HID
devices will work. This is the X joystick input driver.

Reported and tested by:

Daichi GOTO and Masanori OZAWA.

src/sys/dev/usb2/core/usb2_process.c

Correct USB process names.

Reported by:

Andre Guibert de Bruet

src/sys/dev/usb2/serial/uftdi2.c

Integrate changes from old USB stack.

Submitted by:	hps
2009-02-02 00:49:39 +00:00
Dag-Erling Smørgrav e404f75180 Add __BEGIN_DECLS / __END_DECLS so this can be used in C++ code.
MFC after:	1 week
2004-06-03 15:04:24 +00:00
Maksim Yevmenkin e898d5ad97 Do not cast dval.
Make global _usage_page unsigned.

Reviewed by:	imp (mentor)
2004-02-11 21:09:13 +00:00
Matthew N. Dodd cf0e07e504 Sync with NetBSD.
- Bump shared library version on libusbhid.
- Retire libusbhid.h; it is called usbhid.h now.
- hid_start_parse() takes a third argument.
- hid_locate() takes a fifth argument.
- hid_report_size() order of arguments changes.
- Other changes, including formatting and whitespace.

Bump __FreeBSD_version.

This change will break all third party applications that rely on previous
FreeBSD specific behavior.
2003-04-09 01:52:49 +00:00
Matthew N. Dodd 234e6b87fa MF NetBSD:
- Reduce diffs with NetBSD.
  - Formatting and explicit values for enum declaration.
  - Order of prototypes.
  - zero report_size in hid_clear_local()
  - errx() needs no newline
  - Don't initialie variable in declaration in hid_parse_usage_in_page().
- Use fmtcheck() in hid_usage_in_page().
2003-04-07 00:49:53 +00:00
David E. O'Brien 69160b1eb7 Remove __P() usage. 2002-03-21 23:54:04 +00:00
Bruce Evans ea81d4327f Added used include of <sys/cdefs.h>.
Declare all the interfaces documented in usb.3 (2 were missing).
2001-02-06 00:54:00 +00:00
Nick Hibma b425e31947 Sync with NetBSD:
K&R -> ANSI

Bugfix: 'Keep the bit position even when the report descriptor says POP.'

Add hid_use_report_desc, hid_parse_usage_page, hid_parse_usage_in_page.

Changed iface for hid_report_size.
2000-10-16 18:13:59 +00:00
Nick Hibma 25d1d43d78 Sync with NetBSD:
Print unknown usages with 4 digits.
Mask in page extraction.
2000-08-26 13:53:27 +00:00
Nick Hibma 9e2046dfec The USB library from NetBSD by Lennart Augustsson <lennart@augustsson.net>. 2000-06-11 18:19:14 +00:00