Commit e6f3e5e016cc7473bc008f341d8e22bd989e03cb
1 parent
159f3663
OHCI large packet fix.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1939 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
7 additions
and
1 deletions
hw/usb-ohci.c
... | ... | @@ -419,6 +419,7 @@ static void ohci_copy_td(struct ohci_td *td, uint8_t *buf, int len, int write) |
419 | 419 | if (n == len) |
420 | 420 | return; |
421 | 421 | ptr = td->be & ~0xfffu; |
422 | + buf += n; | |
422 | 423 | cpu_physical_memory_rw(ptr, buf, len - n, write); |
423 | 424 | } |
424 | 425 | |
... | ... | @@ -474,7 +475,12 @@ static int ohci_service_td(OHCIState *ohci, struct ohci_ed *ed) |
474 | 475 | return 1; |
475 | 476 | } |
476 | 477 | if (td.cbp && td.be) { |
477 | - len = (td.be - td.cbp) + 1; | |
478 | + if ((td.cbp & 0xfffff000) != (td.be & 0xfffff000)) { | |
479 | + len = (td.be & 0xfff) + 0x1001 - (td.cbp & 0xfff); | |
480 | + } else { | |
481 | + len = (td.be - td.cbp) + 1; | |
482 | + } | |
483 | + | |
478 | 484 | if (len && dir != OHCI_TD_DIR_IN) { |
479 | 485 | ohci_copy_td(&td, buf, len, 0); |
480 | 486 | } | ... | ... |