hidmap: Implement forbidden flag for hidmap item.
If HID usage is mapped to evdev event by hidmap item marked with this flag than entire driver attachment is blocked. MFC after: 2 week
This commit is contained in:
parent
0075742d18
commit
cded1fdb37
@ -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;
|
||||
}
|
||||
|
@ -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) \
|
||||
|
Loading…
Reference in New Issue
Block a user