提交 12cd5b98 编写于 作者: R Roy Hashimoto 提交者: Greg Kroah-Hartman

USB: fix gadgetfs class request delegation

gadgetfs (drivers/usb/gadget/inode.c) was not delegating all
non-device requests to userspace.  This patch makes the handling of
all request cases consistent.
Signed-off-by: NRoy Hashimoto <hashimot@alumni.caltech.edu>
Acked-by: NDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 7c12c92f
......@@ -1458,7 +1458,7 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
/* currently one config, two speeds */
case USB_REQ_SET_CONFIGURATION:
if (ctrl->bRequestType != 0)
break;
goto unrecognized;
if (0 == (u8) w_value) {
value = 0;
dev->current_config = 0;
......@@ -1505,7 +1505,7 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
/* PXA automagically handles this request too */
case USB_REQ_GET_CONFIGURATION:
if (ctrl->bRequestType != 0x80)
break;
goto unrecognized;
*(u8 *)req->buf = dev->current_config;
value = min (w_length, (u16) 1);
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册