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>
This commit is contained in:
Gerd Hoffmann 2010-11-26 12:35:10 +01:00
parent 30c7d32a0a
commit 41c6abbdeb
9 changed files with 7 additions and 29 deletions

View file

@ -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;