Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147649670
D2229.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
819 B
Referenced Files
None
Subscribers
None
D2229.diff
View Options
Index: head/usr.sbin/bluetooth/bthidd/hid.c
===================================================================
--- head/usr.sbin/bluetooth/bthidd/hid.c
+++ head/usr.sbin/bluetooth/bthidd/hid.c
@@ -165,9 +165,21 @@
continue;
page = HID_PAGE(h.usage);
- usage = HID_USAGE(h.usage);
val = hid_get_data(data, &h);
+ /*
+ * When the input field is an array and the usage is specified
+ * with a range instead of an ID, we have to derive the actual
+ * usage by using the item value as an index in the usage range
+ * list.
+ */
+ if ((h.flags & HIO_VARIABLE)) {
+ usage = HID_USAGE(h.usage);
+ } else {
+ const uint32_t usage_offset = val - h.logical_minimum;
+ usage = HID_USAGE(h.usage_minimum + usage_offset);
+ }
+
switch (page) {
case HUP_GENERIC_DESKTOP:
switch (usage) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 13, 2:28 PM (21 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29626770
Default Alt Text
D2229.diff (819 B)
Attached To
Mode
D2229: bthidd: Consider usage ranges when dealing with array inputs.
Attached
Detach File
Event Timeline
Log In to Comment