diff options
author | Anton Tikhomirov <av.tikhomirov@samsung.com> | 2011-04-21 04:06:40 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-05-02 20:00:26 -0400 |
commit | 26ab3d0ce95c270b1ca491d6970aa14852d8e5a3 (patch) | |
tree | e2e09d71f485a3e2415a57ec50a227740771f5f5 /drivers/usb/gadget/s3c-hsotg.c | |
parent | a3395f0dd016f18273eac8e689e1e81e075e025e (diff) |
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>
Diffstat (limited to 'drivers/usb/gadget/s3c-hsotg.c')
-rw-r--r-- | drivers/usb/gadget/s3c-hsotg.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index d7a279bb51dc..cbbc33677fd4 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c | |||
@@ -1055,8 +1055,10 @@ static int s3c_hsotg_ep_sethalt(struct usb_ep *ep, int value); | |||
1055 | static int s3c_hsotg_process_req_feature(struct s3c_hsotg *hsotg, | 1055 | static int s3c_hsotg_process_req_feature(struct s3c_hsotg *hsotg, |
1056 | struct usb_ctrlrequest *ctrl) | 1056 | struct usb_ctrlrequest *ctrl) |
1057 | { | 1057 | { |
1058 | struct s3c_hsotg_ep *ep0 = &hsotg->eps[0]; | ||
1058 | bool set = (ctrl->bRequest == USB_REQ_SET_FEATURE); | 1059 | bool set = (ctrl->bRequest == USB_REQ_SET_FEATURE); |
1059 | struct s3c_hsotg_ep *ep; | 1060 | struct s3c_hsotg_ep *ep; |
1061 | int ret; | ||
1060 | 1062 | ||
1061 | dev_dbg(hsotg->dev, "%s: %s_FEATURE\n", | 1063 | dev_dbg(hsotg->dev, "%s: %s_FEATURE\n", |
1062 | __func__, set ? "SET" : "CLEAR"); | 1064 | __func__, set ? "SET" : "CLEAR"); |
@@ -1072,6 +1074,13 @@ static int s3c_hsotg_process_req_feature(struct s3c_hsotg *hsotg, | |||
1072 | switch (le16_to_cpu(ctrl->wValue)) { | 1074 | switch (le16_to_cpu(ctrl->wValue)) { |
1073 | case USB_ENDPOINT_HALT: | 1075 | case USB_ENDPOINT_HALT: |
1074 | s3c_hsotg_ep_sethalt(&ep->ep, set); | 1076 | s3c_hsotg_ep_sethalt(&ep->ep, set); |
1077 | |||
1078 | ret = s3c_hsotg_send_reply(hsotg, ep0, NULL, 0); | ||
1079 | if (ret) { | ||
1080 | dev_err(hsotg->dev, | ||
1081 | "%s: failed to send reply\n", __func__); | ||
1082 | return ret; | ||
1083 | } | ||
1075 | break; | 1084 | break; |
1076 | 1085 | ||
1077 | default: | 1086 | default: |
@@ -1148,14 +1157,6 @@ static void s3c_hsotg_process_control(struct s3c_hsotg *hsotg, | |||
1148 | dev_dbg(hsotg->dev, "driver->setup() ret %d\n", ret); | 1157 | dev_dbg(hsotg->dev, "driver->setup() ret %d\n", ret); |
1149 | } | 1158 | } |
1150 | 1159 | ||
1151 | if (ret > 0) { | ||
1152 | if (!ep0->dir_in) { | ||
1153 | /* need to generate zlp in reply or take data */ | ||
1154 | /* todo - deal with any data we might be sent? */ | ||
1155 | ret = s3c_hsotg_send_reply(hsotg, ep0, NULL, 0); | ||
1156 | } | ||
1157 | } | ||
1158 | |||
1159 | /* the request is either unhandlable, or is not formatted correctly | 1160 | /* the request is either unhandlable, or is not formatted correctly |
1160 | * so respond with a STALL for the status stage to indicate failure. | 1161 | * so respond with a STALL for the status stage to indicate failure. |
1161 | */ | 1162 | */ |