aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Hibma <n_hibma@FreeBSD.org>2000-10-17 17:13:38 +0000
committerNick Hibma <n_hibma@FreeBSD.org>2000-10-17 17:13:38 +0000
commit1d10fe506252350fd9163836c81335260dbf3ec4 (patch)
tree4226fdfd2db496e74b8d0abea4d55b00cb1d19e1
parente77c53b0be6a298bf67064d115e7ec11fc4203d5 (diff)
downloadsrc-1d10fe506252350fd9163836c81335260dbf3ec4.tar.gz
src-1d10fe506252350fd9163836c81335260dbf3ec4.zip
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.
Notes
Notes: svn path=/head/; revision=67256
-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 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, 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) {