From 1d10fe506252350fd9163836c81335260dbf3ec4 Mon Sep 17 00:00:00 2001 From: Nick Hibma Date: Tue, 17 Oct 2000 17:13:38 +0000 Subject: [PATCH] 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. --- usr.bin/usbhidctl/usbhid.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/usr.bin/usbhidctl/usbhid.c b/usr.bin/usbhidctl/usbhid.c index 8dd1e5f810e0..48eab2c17427 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, 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_output); + printf("Total output size %d bytes\n", 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) {