diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2010-11-26 12:35:10 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2011-01-11 15:56:01 +0100 |
commit | 41c6abbdeb5a86a135ee80a30541ecf52ffd3e23 (patch) | |
tree | d53c643fa046fffb4b4587cc4edf3d92319609f3 /hw/usb-desc.c | |
parent | 30c7d32a0a822a9496aee51e7269073311339ed9 (diff) | |
download | qemu-41c6abbdeb5a86a135ee80a30541ecf52ffd3e23.zip |
usb: move USB_REQ_SET_ADDRESS handling to common code
USB_REQ_SET_ADDRESS handling is identical in *all* emulated devices.
Move it to common code.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb-desc.c')
-rw-r--r-- | hw/usb-desc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/usb-desc.c b/hw/usb-desc.c index 69ab207703..3e87f46d7b 100644 --- a/hw/usb-desc.c +++ b/hw/usb-desc.c @@ -266,6 +266,12 @@ int usb_desc_handle_control(USBDevice *dev, int request, int value, assert(desc != NULL); switch(request) { + case DeviceOutRequest | USB_REQ_SET_ADDRESS: + dev->addr = value; + trace_usb_set_addr(dev->addr); + ret = 0; + break; + case DeviceRequest | USB_REQ_GET_DESCRIPTOR: ret = usb_desc_get_descriptor(dev, value, data, length); break; |