usb/101761: [usb67] [patch] [request] usb.h: increase maximal
size of report descriptor
Dmitry Marakasov
amdmi3 at amdmi3.ru
Tue Aug 25 01:59:01 UTC 2009
* gavin at FreeBSD.org (gavin at FreeBSD.org) wrote:
> To submitter: I'm not sure what the state is of this PR. It looks like the
> problem has not yet been fixed in FreeBSD 6 or 7, but I don't know if it is
> still an issue with the new USB stack in 8.x. Do you happen to know if this
> PR is still valid against the new USB stack? Thanks!
...after some digging....
First of all, my joystick seem to have at least two reports. Report #0
is empty, report #1 has actual axis/button/... data.
With regard to that, usbhidctl is buggy. First of all, static int
reportid variable is never written to but is read in 3 places. It
seems like it's initialized with zero, and thus the utility tries to
work with report #0, giving no data. It seems like reportid should be
initialized to -1 which I suppose reports all report secrs. Also, there
should be a way to select specific report id with command line flags
(likely that was intended usege for this variable).
After initializing reportid to -1 I can get report descriptor, and yes,
answering original question, it is not truncated. Judging from code
rc/lib/libusbhid/descr.c:hid_get_report_desc, the upper limit is now
65535 bytes, which is enough for my device with 1343 byte report descr.
However, after using -1 as reportid, usbhidctl still reports wrong
sizes:
Total input size 0 bytes
Total output size 0 bytes
Total feature size 0 bytes
likely that's because hid_report_size() is called with id=0 (not even
reportid). Seems like it doesn't work with id=-1 as well, so the correct
way is likely to get sizes from hid_item structs. In either case,
libusbhid seems to lack a way to get a number of reports to be able to
parse them one by one.
--
Dmitry Marakasov . 55B5 0596 FF1E 8D84 5F56 9510 D35A 80DD F9D2 F77D
amdmi3 at amdmi3.ru ..: jabber: amdmi3 at jabber.ru http://www.amdmi3.ru
More information about the freebsd-usb
mailing list