USB: g_printer required set interface request
authorJonas Andersson <jonas@microbit.se>
Mon, 21 Mar 2011 13:54:09 +0000 (14:54 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 30 Apr 2011 00:24:31 +0000 (17:24 -0700)
g_printer reqiured "set interface" request from host. Not all hosts send
this request.  This patch enable the interface when it get "set
configuration" request from host.

Signed-off-by: Jonas Andersson <jonas@microbit.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/printer.c

index c3f2bd42bd5aec22861f0ad7650bb942621537b9..271ef94668e719867d12c00a9ce9c1681c825f23 100644 (file)
@@ -1189,6 +1189,8 @@ printer_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
                        else if (gadget->a_alt_hnp_support)
                                DBG(dev, "HNP needs a different root port\n");
                        value = printer_set_config(dev, wValue);
+                       if (!value)
+                               value = set_interface(dev, PRINTER_INTERFACE);
                        break;
                case USB_REQ_GET_CONFIGURATION:
                        if (ctrl->bRequestType != USB_DIR_IN)