Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MOdEU-0003uE-D6 for qemu-devel@nongnu.org; Wed, 08 Jul 2009 15:55:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MOdEP-0003sG-JX for qemu-devel@nongnu.org; Wed, 08 Jul 2009 15:55:09 -0400 Received: from [199.232.76.173] (port=43918 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MOdEP-0003sD-By for qemu-devel@nongnu.org; Wed, 08 Jul 2009 15:55:05 -0400 Received: from bu3sch.de ([62.75.166.246]:48580 helo=vs166246.vserver.de) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MOdEO-0004mB-RW for qemu-devel@nongnu.org; Wed, 08 Jul 2009 15:55:05 -0400 Received: by vs166246.vserver.de with esmtpa (Exim 4.69) id 1MOdEK-00025J-Vf for qemu-devel@nongnu.org; Wed, 08 Jul 2009 19:55:01 +0000 From: Michael Buesch Date: Wed, 8 Jul 2009 21:54:28 +0200 MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200907082154.28259.mb@bu3sch.de> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] usb-ohci: Fix endianness issue List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This fixes a possible endianness issue in the usb-ohci hw module. hcca.frame and ohci->frame_number are 16bit, so use cpu_to_le16(). Signed-off-by: Michael Buesch --- hw/usb-ohci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- qemu-0.10.5.orig/hw/usb-ohci.c +++ qemu-0.10.5/hw/usb-ohci.c @@ -1109,9 +1109,9 @@ static void ohci_frame_boundary(void *op /* Frame boundary, so do EOF stuf here */ ohci->frt = ohci->fit; - /* XXX: endianness */ + /* Increment frame number and take care of endianness. */ ohci->frame_number = (ohci->frame_number + 1) & 0xffff; - hcca.frame = cpu_to_le32(ohci->frame_number); + hcca.frame = cpu_to_le16(ohci->frame_number); if (ohci->done_count == 0 && !(ohci->intr_status & OHCI_INTR_WD)) { if (!ohci->done) -- Greetings, Michael.