aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/hid
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/hid')
-rw-r--r--sys/dev/hid/hidmap.c5
-rw-r--r--sys/dev/hid/hidmap.h3
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/hid/hidmap.c b/sys/dev/hid/hidmap.c
index 46e789fa7cec..c46930214323 100644
--- a/sys/dev/hid/hidmap.c
+++ b/sys/dev/hid/hidmap.c
@@ -481,7 +481,10 @@ hidmap_probe_hid_descr(void *d_ptr, hid_size_t d_len, uint8_t tlc_index,
/* Check that all mandatory usages are present in report descriptor */
if (items != 0) {
for (i = 0; i < nitems_map; i++) {
- if (map[i].required && isclr(caps, i)) {
+ KASSERT(!(map[i].required && map[i].forbidden),
+ ("both required & forbidden item flags are set"));
+ if ((map[i].required && isclr(caps, i)) ||
+ (map[i].forbidden && isset(caps, i))) {
items = 0;
break;
}
diff --git a/sys/dev/hid/hidmap.h b/sys/dev/hid/hidmap.h
index 6ac23b3dc4ee..f5ce10069e1a 100644
--- a/sys/dev/hid/hidmap.h
+++ b/sys/dev/hid/hidmap.h
@@ -98,7 +98,8 @@ struct hidmap_item {
bool has_cb:1;
bool final_cb:1;
bool invert_value:1;
- u_int reserved:10;
+ bool forbidden:1; /* Forbidden by driver */
+ u_int reserved:9;
};
#define HIDMAP_ANY(_page, _usage, _type, _code) \