diff options
author | Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org> | 2010-03-10 10:45:12 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-03-17 11:17:05 -0500 |
commit | e5322f76a72352eea8eb511390c27726b64e5a87 (patch) | |
tree | 893f3cd360799063f05ec03ff9ca043f1c7bf3d0 /hw | |
parent | 314b1811c15f4e982e4667d9b845aee4b5a63d91 (diff) | |
download | qemu-e5322f76a72352eea8eb511390c27726b64e5a87.zip qemu-e5322f76a72352eea8eb511390c27726b64e5a87.tar.gz qemu-e5322f76a72352eea8eb511390c27726b64e5a87.tar.bz2 |
hw/usb-msd: fix some usb requests
The usb-msd device emulation needs some small tweaks in the requests
emulations. For instance, the reset/maxlun requests are class/interface
specific so requests for them with the type class and recipient interface
bits sets have to be handled.
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/usb-msd.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/usb-msd.c b/hw/usb-msd.c index e90a47e..e9235ea 100644 --- a/hw/usb-msd.c +++ b/hw/usb-msd.c @@ -321,17 +321,19 @@ static int usb_msd_handle_control(USBDevice *dev, int request, int value, ret = 0; break; case EndpointOutRequest | USB_REQ_CLEAR_FEATURE: - if (value == 0 && index != 0x81) { /* clear ep halt */ - goto fail; - } + ret = 0; + break; + case InterfaceOutRequest | USB_REQ_SET_INTERFACE: ret = 0; break; /* Class specific requests. */ + case (((USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8) | MassStorageReset): case MassStorageReset: /* Reset state ready for the next CBW. */ s->mode = USB_MSDM_CBW; ret = 0; break; + case (((USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8) | GetMaxLun): case GetMaxLun: data[0] = 0; ret = 1; |