From a980a065fb5e86d6dec337e6cb6ff432f1a143c9 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 26 Nov 2010 20:20:41 +0100 Subject: usb: move USB_REQ_{GET,SET}_CONFIGURATION handling to common code This patch adds fields to the USBDevice struct for the current speed (hard-wired to full speed for now) and current device configuration. Also a init function is added which inializes these fields. This allows USB_REQ_{GET,SET}_CONFIGURATION handling to be moved to common code. For most drivers the conversion is trivial ad they support a single configuration only anyway. One exception is bluetooth where some device-specific setup code runs after get/set configuration. The other is usb-net which actually has two configurations so the the code to check for the active configuration has been adapted. Signed-off-by: Gerd Hoffmann --- hw/usb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'hw/usb.h') diff --git a/hw/usb.h b/hw/usb.h index 7b5c8df..966d47e 100644 --- a/hw/usb.h +++ b/hw/usb.h @@ -164,6 +164,8 @@ struct USBDevice { int setup_index; QLIST_HEAD(, USBDescString) strings; + const USBDescDevice *device; + const USBDescConfig *config; }; struct USBDeviceInfo { -- cgit v1.1