From ed5a83ddd8c1d8ec7b1015315530cf29949e7c48 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 30 Nov 2010 17:35:34 +0100 Subject: usb: move remote wakeup handling to common code This patch moves setting and clearing the remote_wakeup feature bit (via USB_REQ_{SET,CLEAR}_FEATURE) to common code. Also USB_REQ_GET_STATUS handling is moved to common code. Signed-off-by: Gerd Hoffmann --- hw/usb-net.c | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'hw/usb-net.c') diff --git a/hw/usb-net.c b/hw/usb-net.c index f12304590b..bf51bb3890 100644 --- a/hw/usb-net.c +++ b/hw/usb-net.c @@ -1055,31 +1055,6 @@ static int usb_net_handle_control(USBDevice *dev, int request, int value, ret = 0; switch(request) { - case DeviceRequest | USB_REQ_GET_STATUS: - data[0] = (1 << USB_DEVICE_SELF_POWERED) | - (dev->remote_wakeup << USB_DEVICE_REMOTE_WAKEUP); - data[1] = 0x00; - ret = 2; - break; - - case DeviceOutRequest | USB_REQ_CLEAR_FEATURE: - if (value == USB_DEVICE_REMOTE_WAKEUP) { - dev->remote_wakeup = 0; - } else { - goto fail; - } - ret = 0; - break; - - case DeviceOutRequest | USB_REQ_SET_FEATURE: - if (value == USB_DEVICE_REMOTE_WAKEUP) { - dev->remote_wakeup = 1; - } else { - goto fail; - } - ret = 0; - break; - case ClassInterfaceOutRequest | USB_CDC_SEND_ENCAPSULATED_COMMAND: if (!is_rndis(s) || value || index != 0) { goto fail; -- cgit v1.2.3-55-g7522