qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] usb-ohci: Fix endianness issue


From: Michael Buesch
Subject: [Qemu-devel] [PATCH] usb-ohci: Fix endianness issue
Date: Wed, 8 Jul 2009 21:54:28 +0200
User-agent: KMail/1.9.9

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 <address@hidden>

---
 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]