diff options
author | Michael Buesch <mb@bu3sch.de> | 2009-07-08 21:54:28 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-07-10 13:41:20 -0500 |
commit | 1fa63e43e64596455938e09d3e6ec89eb0c4bbc8 (patch) | |
tree | a6f6c1b88134a8c93d751dea42ac9684b97888a6 | |
parent | e6a0575e98179167bc5f7ab792c3d19f9852ee5f (diff) | |
download | qemu-1fa63e43e64596455938e09d3e6ec89eb0c4bbc8.zip qemu-1fa63e43e64596455938e09d3e6ec89eb0c4bbc8.tar.gz qemu-1fa63e43e64596455938e09d3e6ec89eb0c4bbc8.tar.bz2 |
usb-ohci: Fix endianness issue
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 <mb@bu3sch.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r-- | hw/usb-ohci.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c index 23b5e21..83d1a5c 100644 --- a/hw/usb-ohci.c +++ b/hw/usb-ohci.c @@ -1150,9 +1150,9 @@ static void ohci_frame_boundary(void *opaque) /* 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) |