svn commit: r224549 - projects/hid/sys/dev/usb/input
Alexander Motin
mav at FreeBSD.org
Sun Jul 31 16:08:29 UTC 2011
Author: mav
Date: Sun Jul 31 16:08:29 2011
New Revision: 224549
URL: http://svn.freebsd.org/changeset/base/224549
Log:
Tune USB_GET_REPORT/USB_SET_REPORT IOCTLs to work with multiple report,
possibly with different sizes.
Modified:
projects/hid/sys/dev/usb/input/uhid.c
Modified: projects/hid/sys/dev/usb/input/uhid.c
==============================================================================
--- projects/hid/sys/dev/usb/input/uhid.c Sun Jul 31 15:23:21 2011 (r224548)
+++ projects/hid/sys/dev/usb/input/uhid.c Sun Jul 31 16:08:29 2011 (r224549)
@@ -566,8 +566,10 @@ uhid_ioctl(struct usb_fifo *fifo, u_long
default:
return (EINVAL);
}
+ if (id != 0)
+ copyin(ugd->ugd_data, &id, 1);
error = uhid_get_report(sc, ugd->ugd_report_type, id,
- NULL, ugd->ugd_data, size);
+ NULL, ugd->ugd_data, imin(ugd->ugd_maxlen, size));
break;
case USB_SET_REPORT:
@@ -592,8 +594,10 @@ uhid_ioctl(struct usb_fifo *fifo, u_long
default:
return (EINVAL);
}
+ if (id != 0)
+ copyin(ugd->ugd_data, &id, 1);
error = uhid_set_report(sc, ugd->ugd_report_type, id,
- NULL, ugd->ugd_data, size);
+ NULL, ugd->ugd_data, imin(ugd->ugd_maxlen, size));
break;
case USB_GET_REPORT_ID:
More information about the svn-src-projects
mailing list