mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
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:
parent
30c7d32a0a
commit
41c6abbdeb
9 changed files with 7 additions and 29 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue