Date: Sat, 31 Oct 2009 13:07:09 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 169992 for review Message-ID: <200910311307.n9VD79ab068295@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/chv.cgi?CH=169992 Change 169992 by hselasky@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 */ }; /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910311307.n9VD79ab068295>