Commit Graph

58 Commits

Author SHA1 Message Date
jakllsch be561d813d Sync with OpenBSD 2024-03-14 15:39:23 +00:00
jakllsch 8f746c3921 Remove Reserved usages and ranges thereof
Helps align with future merge
2024-03-14 15:27:22 +00:00
jakllsch 8fc95d6b5f fix typos 2024-03-14 15:23:52 +00:00
andvar a10c2cec39 fix various typos in comments and log messages. 2024-02-10 09:21:51 +00:00
andvar 100a3398b8 fix spelling mistakes, mainly in comments and log messages. 2024-02-09 22:08:30 +00:00
charlotte bad55ec264 usbhid.3: hid_parse_usage_in_page() actually returns int 2022-05-22 05:33:46 +00:00
nia cce5ae2abd usbhid(3): use reallocarr 2021-11-03 16:18:09 +00:00
fox a4861c96ec lib/libusbhid: Fix possible left shift changes signedness bit.
This bug was reported by UBSan runs.

lib/libusbhid/parse.c:246:20

Can result in left shift changes signedness bit as a side effect positive number
can go negative, cast it to unsigned for the operation and silence the issue.

Reviewed by: kamil@
2020-04-04 21:26:16 +00:00
fox f76ca3088f lib/libusbhid: Fix possible left shift changes signedness bit.
This bug was reported by UBSan runs.

lib/libusbhid/usage.c:247:27
lib/libusbhid/usage.c:244:28
lib/libusbhid/usage.c:235:13

Can result in left shift changes signedness bit as a side effect positive number
can go negative, cast it to unsigned for the operation and silence the issue.

Reviewed by: kamil@
2020-04-04 21:23:04 +00:00
fox ef659d5053 lib/libusbhid: Fix possible left shift changes signedness bit.
This bug was reported by UBSan runs.

lib/libusbhid/data.c:58:25
lib/libusbhid/data.c:91:7
lib/libusbhid/data.c:92:7

Can result in left shift changes signedness bit as a side effect positive number
can go negative, cast it to unsigned for the operation and silence the issue.

Reviewed by: kamil@
2020-04-04 21:21:35 +00:00
bouyer 878cb1cfc5 Fix fallout from hid factorisation:
- need to install sys/dev/hid/hid.h for userland
- include it where needed - most of the time in place if usb/usbhid.h
2017-12-10 20:38:13 +00:00
abhinav 1cfbd11bb0 Add hid_parse_usage_page and hid_parse_usage_in_page to the NAME section 2017-10-22 16:49:13 +00:00
wiz 01869ca4d2 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
dholland fd9823afae Uses __BEGIN_DECLS so needs sys/cdefs.h; also needs stdint.h.
And, while here, add missing include guard.
2016-01-22 23:51:23 +00:00
jakllsch d804fd3f29 Fix buffer-overrun/off-by-one in hid_set_data(3).
(The tests only detected this as a problem on ARMv7, not i386.)
2016-01-07 19:49:45 +00:00
jakllsch f9e98a931a Don't crash when the device's HID Report Descriptor Pops from an empty stack. 2016-01-07 16:10:49 +00:00
christos 10deb451c0 minor type fixes. 2016-01-02 21:58:10 +00:00
jakllsch aaf9a4516d Teach hid_parse_usage_in_page() how to understand hex literals, in
addition to the usual table lookup.
2016-01-02 01:24:44 +00:00
jakllsch f5863ab3d2 Fix round-trip of hid_usage_in_page(hid_parse_usage_in_page()) when
the usage is a catch-all format string.

This should allow usbhidctl(1) to understand an item argument of
"Button:Button_65535".
2016-01-02 01:04:15 +00:00
jakllsch c8b0c3452c Fix hid_get_data() for negative or 32-bit report data. 2016-01-01 22:59:12 +00:00
jakllsch f74c09dad4 Alphanumeric is spelled Alphanumeric 2016-01-01 19:14:45 +00:00
jakllsch f8ec6d43b4 compare pointer against NULL instead of 0 2015-12-31 20:35:21 +00:00
khorben b15b1c08b5 Extended usb_hid_usages, with help from the equivalent file from FreeBSD.
Favored NetBSD upon conflicts, except for a typo and consistency.

ok riz@
2012-05-09 16:21:06 +00:00
njoly a973b36486 Use Lk macro when dealing with URLs. Another part of PR/29238. 2012-03-15 19:04:46 +00:00
christos fc5fe3c352 PR/45850: Pierre Pronchery: USB multi-touch panels are not supported 2012-01-17 03:49:19 +00:00
joerg afa03266a7 Remove pointless self-assignment 2011-05-23 15:16:27 +00:00
jakllsch e43287544b Improve usbhid(3) descriptor/report parsing:
Handle signed Physical Minimums
 Handle signed Unit Exponents
2010-08-13 19:56:34 +00:00
plunky 38cd0f0b2e note const from actual API 2010-05-12 18:37:56 +00:00
plunky 7a1cb70b5e hid_get_data() will read an extra byte if the data being read ends on
a byte boundary. This byte is subsequently discarded, but it could be
a byte from memory after the end of the report being parsed.

Fix this by rounding up and ending the loop one earlier.
2010-05-12 18:28:20 +00:00
joerg f63b030c15 Use .In instead of .Ar Pa for header files. 2010-03-22 21:58:31 +00:00
jakllsch ec1d44ba55 Fix copy-paste-o. Per the HID spec, Global Item Tag 0b001101nn is
Physical Minimum, not a alias for Physical Maximum.
2010-01-05 17:57:06 +00:00
jakllsch 23f0810103 Add more Keypad usages in the Keyboard/Keypad page
from USB HID Usage Tables document version 1.11.

Admitedly these are not going to be noticed when ukbd(4) is around.

While here, correct a typo (that's also in the HUT document),
and normalize to ASCII a non-UTF-8 encoding of "moire".

"This may prove useful to some of you someday,
 perhaps in a somewhat bizarre set of circumstances."
                                 - Tom Lehrer
2009-07-10 22:11:58 +00:00
plunky 28aef083c5 add generic Device Controls usage page information 2007-05-24 18:05:11 +00:00
plunky a7ea3f4e89 add const to the data for hid_use_report_desc() since it does
not modify the memory.
2007-04-11 20:56:20 +00:00
drochner 5a0b1292cf add __BEGIN_DECLS/__END_DECLS so that this can be used from c++ libs
(there is code out there -plib/flightgear- which tries this)
2007-03-23 21:37:45 +00:00
christos 8444694a42 cast shift argument in macro. 2006-05-19 14:40:15 +00:00
christos ac579202bd fix debug build. 2006-04-09 00:49:55 +00:00
wiz c23b1a74bb Fix sign extension broken by previous. dillo hacked here too. 2005-12-14 17:35:40 +00:00
christos 684eb06cd8 fix non-portable right shifts. 2005-12-05 02:09:17 +00:00
dsl 1793b7dd69 Use (unsigned char) cast to sanitise arguments to ctype functions. 2004-10-28 21:14:52 +00:00
dsl d349cd6749 Fix a load of international alphabet problems with isxxx() and toupper()
Change isspace(*char_ptr) to isspace(*char_ptr & 0xff) so that the correct
piece of memory is looked at for the bit mask.
gcc optimises out the '& 0xff' (on i386 at least).
Fixes problems found by gcc when the splurious (int) cast is removed
from the #defines in ctype.h
2004-10-27 19:59:24 +00:00
uebayasi 0571d32356 Minor fix in SEE ALSO; put xref first; .Pp before a sentence. 2004-06-10 14:01:45 +00:00
lukem 42415f999d Add entries for items found on the Microsoft Wireless MultiMedia Keyboard 1.1.
Spell "Microsoft" correctly.
2004-05-16 13:22:23 +00:00
augustss a6cfb45c19 The report size is not a local item, so don't clear it when clearing local items. 2004-01-05 17:55:48 +00:00
salo 99410184e7 netbsd.org->NetBSD.org 2003-07-26 19:24:24 +00:00
wiz aeeb4fe3d0 Grammar, spelling, markup fixes from jmc@openbsd. 2003-06-06 13:42:49 +00:00
wiz 472351e13d Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
2003-04-16 13:34:34 +00:00
lukem e2d7870626 add RCSID 2003-03-08 07:42:33 +00:00
grant 104b35fe93 'NetBSD.org' and some mdoc fixes. 2003-02-14 16:29:11 +00:00
wiz 57a4de98d0 New sentence, new line. From Robert Elz. 2002-10-01 19:26:58 +00:00