You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Possibly incorrect expectations on hid_get_feature_report #312
When looking into libusb/hidapi#229, I noticed that the behavior of hid_get_feature_report when report IDs are not used is not as clear as I thought, and perhaps not even well defined.
... which calls the low level driver's raw_request()3
... which, in the case of USB HIDs, calls usbhid_get_raw_report()4
... which ensures that byte 0 will be the report number (or zero) 5
It is possible that other types of HIDs behave differently, but that would still mean a bug in the kernel (in that case, in the actual code, not just in the documentation).
Leaving this open until I report (or maybe fix) it upstream.
changed the title [-]Incorrect expectations on hid_get_feature_report[/-][+]Possibly incorrect expectations on hid_get_feature_report[/+]on Jan 15, 2022
Activity
[-]Incorrect expecations on hid_get_feature_report[/-][+]Incorrect expectations on hid_get_feature_report[/+]jonasmalacofilho commentedon Jan 15, 2022
Actually, the bug appears to be in hidraw's documentation:
HIDIOCGFEATUREsimply callshidraw_get_report()1hid_hw_raw_request()2raw_request()3usbhid_get_raw_report()4It is possible that other types of HIDs behave differently, but that would still mean a bug in the kernel (in that case, in the actual code, not just in the documentation).
Leaving this open until I report (or maybe fix) it upstream.
Footnotes
https://github.com/torvalds/linux/blob/a33f5c380c4bd3fa5278d690421b72052456d9fe/drivers/hid/hidraw.c#L425-L429 ↩
https://github.com/torvalds/linux/blob/a33f5c380c4bd3fa5278d690421b72052456d9fe/drivers/hid/hidraw.c#L228-L229 ↩
https://github.com/torvalds/linux/blob/4aa1b8257fba5931511a7e152bcbbb3dd673c6c1/drivers/hid/hid-core.c#L2160-L2170 ↩
https://github.com/torvalds/linux/blob/4aa1b8257fba5931511a7e152bcbbb3dd673c6c1/drivers/hid/usbhid/hid-core.c#L1286-L1298 ↩
https://github.com/torvalds/linux/blob/4aa1b8257fba5931511a7e152bcbbb3dd673c6c1/drivers/hid/usbhid/hid-core.c#L869-L901 ↩
[-]Incorrect expectations on hid_get_feature_report[/-][+]Possibly incorrect expectations on hid_get_feature_report[/+]