summaryrefslogtreecommitdiff
path: root/hw/usb-ohci.c
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-05-25 23:37:07 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-05-25 23:37:07 +0000
commite6f3e5e016cc7473bc008f341d8e22bd989e03cb (patch)
treedbdaf822c6b73e95cc1ac6aa00de597d8eb2cd30 /hw/usb-ohci.c
parent159f36638898f4ea671b7f56707dc6f1ec9681d4 (diff)
downloadqemu-e6f3e5e016cc7473bc008f341d8e22bd989e03cb.tar.gz
OHCI large packet fix.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1939 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/usb-ohci.c')
-rw-r--r--hw/usb-ohci.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c
index 0cc27232d8..e87d9da70a 100644
--- a/hw/usb-ohci.c
+++ b/hw/usb-ohci.c
@@ -419,6 +419,7 @@ static void ohci_copy_td(struct ohci_td *td, uint8_t *buf, int len, int write)
if (n == len)
return;
ptr = td->be & ~0xfffu;
+ buf += n;
cpu_physical_memory_rw(ptr, buf, len - n, write);
}
@@ -474,7 +475,12 @@ static int ohci_service_td(OHCIState *ohci, struct ohci_ed *ed)
return 1;
}
if (td.cbp && td.be) {
- len = (td.be - td.cbp) + 1;
+ if ((td.cbp & 0xfffff000) != (td.be & 0xfffff000)) {
+ len = (td.be & 0xfff) + 0x1001 - (td.cbp & 0xfff);
+ } else {
+ len = (td.be - td.cbp) + 1;
+ }
+
if (len && dir != OHCI_TD_DIR_IN) {
ohci_copy_td(&td, buf, len, 0);
}