summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-01-06 08:11:41 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-01-06 08:11:41 -0600
commitf3e8275f491ca3dd082e1238c62ca2a0ec740d69 (patch)
tree9341d2187f81724a9151fcefe04e138b5131ab46 /hw
parentc47f3223658119219bbe0b8d09da733d1c06e76f (diff)
parentfd891c9318b112462e54ee1b3b16b074b8bec5b1 (diff)
downloadqemu-f3e8275f491ca3dd082e1238c62ca2a0ec740d69.zip
Merge remote-tracking branch 'kraxel/usb.33' into staging
* kraxel/usb.33: usb-ohci: td.cbp incorrectly updated near page end usb-host: properly release port on unplug & exit usb-storage: cancel I/O on reset Fix parse of usb device description with multiple configurations
Diffstat (limited to 'hw')
-rw-r--r--hw/usb-msd.c12
-rw-r--r--hw/usb-ohci.c6
2 files changed, 15 insertions, 3 deletions
diff --git a/hw/usb-msd.c b/hw/usb-msd.c
index 4c06950125..3147131db4 100644
--- a/hw/usb-msd.c
+++ b/hw/usb-msd.c
@@ -278,6 +278,18 @@ static void usb_msd_handle_reset(USBDevice *dev)
MSDState *s = (MSDState *)dev;
DPRINTF("Reset\n");
+ if (s->req) {
+ scsi_req_cancel(s->req);
+ }
+ assert(s->req == NULL);
+
+ if (s->packet) {
+ USBPacket *p = s->packet;
+ s->packet = NULL;
+ p->result = USB_RET_STALL;
+ usb_packet_complete(dev, p);
+ }
+
s->mode = USB_MSDM_CBW;
}
diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c
index e68be70b15..81488c48e2 100644
--- a/hw/usb-ohci.c
+++ b/hw/usb-ohci.c
@@ -1025,10 +1025,10 @@ static int ohci_service_td(OHCIState *ohci, struct ohci_ed *ed)
if (ret == len) {
td.cbp = 0;
} else {
- td.cbp += ret;
if ((td.cbp & 0xfff) + ret > 0xfff) {
- td.cbp &= 0xfff;
- td.cbp |= td.be & ~0xfff;
+ td.cbp = (td.be & ~0xfff) + ((td.cbp + ret) & 0xfff);
+ } else {
+ td.cbp += ret;
}
}
td.flags |= OHCI_TD_T1;