mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 09:14:19 +08:00
USB: s3c-hsotg: Fix control request processing
UDC driver does not need to generate reply to host if request is delivered to gadget. This is gadget's responsibility. This commit fixes that. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Reviewed-by: Kyoungil Kim<ki0351.kim@samsung.com> Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
a3395f0dd0
commit
26ab3d0ce9
@ -1055,8 +1055,10 @@ static int s3c_hsotg_ep_sethalt(struct usb_ep *ep, int value);
|
|||||||
static int s3c_hsotg_process_req_feature(struct s3c_hsotg *hsotg,
|
static int s3c_hsotg_process_req_feature(struct s3c_hsotg *hsotg,
|
||||||
struct usb_ctrlrequest *ctrl)
|
struct usb_ctrlrequest *ctrl)
|
||||||
{
|
{
|
||||||
|
struct s3c_hsotg_ep *ep0 = &hsotg->eps[0];
|
||||||
bool set = (ctrl->bRequest == USB_REQ_SET_FEATURE);
|
bool set = (ctrl->bRequest == USB_REQ_SET_FEATURE);
|
||||||
struct s3c_hsotg_ep *ep;
|
struct s3c_hsotg_ep *ep;
|
||||||
|
int ret;
|
||||||
|
|
||||||
dev_dbg(hsotg->dev, "%s: %s_FEATURE\n",
|
dev_dbg(hsotg->dev, "%s: %s_FEATURE\n",
|
||||||
__func__, set ? "SET" : "CLEAR");
|
__func__, set ? "SET" : "CLEAR");
|
||||||
@ -1072,6 +1074,13 @@ static int s3c_hsotg_process_req_feature(struct s3c_hsotg *hsotg,
|
|||||||
switch (le16_to_cpu(ctrl->wValue)) {
|
switch (le16_to_cpu(ctrl->wValue)) {
|
||||||
case USB_ENDPOINT_HALT:
|
case USB_ENDPOINT_HALT:
|
||||||
s3c_hsotg_ep_sethalt(&ep->ep, set);
|
s3c_hsotg_ep_sethalt(&ep->ep, set);
|
||||||
|
|
||||||
|
ret = s3c_hsotg_send_reply(hsotg, ep0, NULL, 0);
|
||||||
|
if (ret) {
|
||||||
|
dev_err(hsotg->dev,
|
||||||
|
"%s: failed to send reply\n", __func__);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -1148,14 +1157,6 @@ static void s3c_hsotg_process_control(struct s3c_hsotg *hsotg,
|
|||||||
dev_dbg(hsotg->dev, "driver->setup() ret %d\n", ret);
|
dev_dbg(hsotg->dev, "driver->setup() ret %d\n", ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret > 0) {
|
|
||||||
if (!ep0->dir_in) {
|
|
||||||
/* need to generate zlp in reply or take data */
|
|
||||||
/* todo - deal with any data we might be sent? */
|
|
||||||
ret = s3c_hsotg_send_reply(hsotg, ep0, NULL, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* the request is either unhandlable, or is not formatted correctly
|
/* the request is either unhandlable, or is not formatted correctly
|
||||||
* so respond with a STALL for the status stage to indicate failure.
|
* so respond with a STALL for the status stage to indicate failure.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user