PERFORCE change 169992 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Sat Oct 31 13:07:09 UTC 2009
http://p4web.freebsd.org/chv.cgi?CH=169992
Change 169992 by hselasky at hselasky_laptop001 on 2009/10/31 13:06:29
USB CORE:
- correct Linux Compatibility error codes for short
isochronous IN transfers and make status field signed.
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb/usb_compat_linux.c#50 edit
.. //depot/projects/usb/src/sys/dev/usb/usb_compat_linux.h#24 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb/usb_compat_linux.c#50 (text+ko) ====
@@ -1362,8 +1362,17 @@
for (x = 0; x < urb->number_of_packets; x++) {
uipd = urb->iso_frame_desc + x;
+ if (uipd->actual_length > xfer->frlengths[x]) {
+ if (urb->transfer_flags & URB_SHORT_NOT_OK) {
+ /* XXX should be EREMOTEIO */
+ uipd->status = -EPIPE;
+ } else {
+ uipd->status = 0;
+ }
+ } else {
+ uipd->status = 0;
+ }
uipd->actual_length = xfer->frlengths[x];
- uipd->status = 0;
if (!xfer->flags.ext_buffer) {
usbd_copy_out(xfer->frbuffers, offset,
USB_ADD_BYTES(urb->transfer_buffer,
@@ -1385,8 +1394,8 @@
if (xfer->actlen < xfer->sumlen) {
/* short transfer */
if (urb->transfer_flags & URB_SHORT_NOT_OK) {
- urb->status = -EPIPE; /* XXX should be
- * EREMOTEIO */
+ /* XXX should be EREMOTEIO */
+ urb->status = -EPIPE;
} else {
urb->status = 0;
}
@@ -1482,6 +1491,7 @@
/* Set zero for "actual_length" */
for (x = 0; x < urb->number_of_packets; x++) {
urb->iso_frame_desc[x].actual_length = 0;
+ urb->iso_frame_desc[x].status = urb->status;
}
/* call callback */
==== //depot/projects/usb/src/sys/dev/usb/usb_compat_linux.h#24 (text+ko) ====
@@ -217,7 +217,7 @@
* packets are usually back to back) */
uint16_t length; /* expected length */
uint16_t actual_length;
- uint16_t status;
+ int16_t status; /* transfer status */
};
/*
More information about the p4-projects
mailing list