Skip to content

Commit c600a55

Browse files
66542eJiri Kosina
authored andcommitted
HID: core: Add reserved item tag for main items
For main items, separate warning of reserved item tag from warning of unknown item tag. This comes from 6.2.2.4 Main Items of Device Class Definition for HID 1.11 specification. Signed-off-by: Tatsuya S <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 27c0278 commit c600a55

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

drivers/hid/hid-core.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,11 @@ static int hid_parser_main(struct hid_parser *parser, struct hid_item *item)
657657
ret = hid_add_field(parser, HID_FEATURE_REPORT, data);
658658
break;
659659
default:
660-
hid_warn(parser->device, "unknown main item tag 0x%x\n", item->tag);
660+
if (item->tag >= HID_MAIN_ITEM_TAG_RESERVED_MIN &&
661+
item->tag <= HID_MAIN_ITEM_TAG_RESERVED_MAX)
662+
hid_warn(parser->device, "reserved main item tag 0x%x\n", item->tag);
663+
else
664+
hid_warn(parser->device, "unknown main item tag 0x%x\n", item->tag);
661665
ret = 0;
662666
}
663667

include/linux/hid.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ struct hid_item {
8181
#define HID_MAIN_ITEM_TAG_FEATURE 11
8282
#define HID_MAIN_ITEM_TAG_BEGIN_COLLECTION 10
8383
#define HID_MAIN_ITEM_TAG_END_COLLECTION 12
84+
#define HID_MAIN_ITEM_TAG_RESERVED_MIN 13
85+
#define HID_MAIN_ITEM_TAG_RESERVED_MAX 15
8486

8587
/*
8688
* HID report descriptor main item contents

0 commit comments

Comments
 (0)