From owner-p4-projects@FreeBSD.ORG Sat Oct 31 13:07:09 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 77E831065694; Sat, 31 Oct 2009 13:07:09 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B5651065679 for ; Sat, 31 Oct 2009 13:07:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 2927D8FC1B for ; Sat, 31 Oct 2009 13:07:09 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n9VD791t068297 for ; Sat, 31 Oct 2009 13:07:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n9VD79ab068295 for perforce@freebsd.org; Sat, 31 Oct 2009 13:07:09 GMT (envelope-from hselasky@FreeBSD.org) Date: Sat, 31 Oct 2009 13:07:09 GMT Message-Id: <200910311307.n9VD79ab068295@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 169992 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Oct 2009 13:07:09 -0000 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 */ }; /*