summaryrefslogtreecommitdiffstats
path: root/usr.bin/usbhidctl/usbhid.c
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>2000-10-17 17:13:38 +0000
committern_hibma <n_hibma@FreeBSD.org>2000-10-17 17:13:38 +0000
commitf7a4717fd2ed3807c8c74dc9aca63619ba745eec (patch)
tree15c8d7b9a3f1ec63575635785506ad86d18dbaf8 /usr.bin/usbhidctl/usbhid.c
parent64c04653165afff3cc50eb40b0f097f44f20e40b (diff)
downloadFreeBSD-src-f7a4717fd2ed3807c8c74dc9aca63619ba745eec.zip
FreeBSD-src-f7a4717fd2ed3807c8c74dc9aca63619ba745eec.tar.gz
Fix the build break.
The solution isn't perfect, instead of printing the first report, it will the report no report id, but the proper solution is more complex than this. We would need to iterate over the report descriptor and figure out all the report id's before starting to print.
Diffstat (limited to 'usr.bin/usbhidctl/usbhid.c')
-rw-r--r--usr.bin/usbhidctl/usbhid.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/usr.bin/usbhidctl/usbhid.c b/usr.bin/usbhidctl/usbhid.c
index 8dd1e5f..48eab2c 100644
--- a/usr.bin/usbhidctl/usbhid.c
+++ b/usr.bin/usbhidctl/usbhid.c
@@ -123,7 +123,7 @@ dumpitems(report_desc_t r)
{
struct hid_data *d;
struct hid_item h;
- int report_id, size;
+ int size;
for (d = hid_start_parse(r, ~0); hid_get_item(d, &h); ) {
switch (h.kind) {
@@ -147,20 +147,14 @@ dumpitems(report_desc_t r)
}
}
hid_end_parse(d);
- size = hid_report_size(r, hid_input, &report_id);
- size -= report_id != 0;
- printf("Total input size %s%d bytes\n",
- report_id && size ? "1+" : "", size);
-
- size = hid_report_size(r, hid_output, &report_id);
- size -= report_id != 0;
- printf("Total output size %s%d bytes\n",
- report_id && size ? "1+" : "", size);
+ size = hid_report_size(r, 0, hid_input);
+ printf("Total input size %s%d bytes\n", size);
+
+ size = hid_report_size(r, 0, hid_output);
+ printf("Total output size %d bytes\n", size);
- size = hid_report_size(r, hid_feature, &report_id);
- size -= report_id != 0;
- printf("Total feature size %s%d bytes\n",
- report_id && size ? "1+" : "", size);
+ size = hid_report_size(r, 0, hid_feature);
+ printf("Total feature size %d bytes\n", size);
}
void
@@ -225,7 +219,7 @@ dumpdata(int f, report_desc_t rd, int loop)
}
hid_end_parse(d);
rev(&hids);
- dlen = hid_report_size(rd, hid_input, &report_id);
+ dlen = hid_report_size(rd, 0, hid_input);
dbuf = malloc(dlen);
if (!loop)
if (ioctl(f, USB_SET_IMMED, &one) < 0) {
OpenPOWER on IntegriCloud