aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/core.h2
-rw-r--r--drivers/usb/dwc3/ep0.c49
2 files changed, 0 insertions, 51 deletions
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index 151eca876dfd..c611d8023368 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -457,7 +457,6 @@ enum dwc3_phy {
457enum dwc3_ep0_next { 457enum dwc3_ep0_next {
458 DWC3_EP0_UNKNOWN = 0, 458 DWC3_EP0_UNKNOWN = 0,
459 DWC3_EP0_COMPLETE, 459 DWC3_EP0_COMPLETE,
460 DWC3_EP0_NRDY_SETUP,
461 DWC3_EP0_NRDY_DATA, 460 DWC3_EP0_NRDY_DATA,
462 DWC3_EP0_NRDY_STATUS, 461 DWC3_EP0_NRDY_STATUS,
463}; 462};
@@ -779,7 +778,6 @@ struct dwc3_event_depevt {
779#define DEPEVT_STREAMEVT_NOTFOUND 2 778#define DEPEVT_STREAMEVT_NOTFOUND 2
780 779
781/* Control-only Status */ 780/* Control-only Status */
782#define DEPEVT_STATUS_CONTROL_SETUP 0
783#define DEPEVT_STATUS_CONTROL_DATA 1 781#define DEPEVT_STATUS_CONTROL_DATA 1
784#define DEPEVT_STATUS_CONTROL_STATUS 2 782#define DEPEVT_STATUS_CONTROL_STATUS 2
785 783
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index 28bce9be30bc..d4b38c72a0ac 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -809,12 +809,6 @@ static void dwc3_ep0_xfer_complete(struct dwc3 *dwc,
809 } 809 }
810} 810}
811 811
812static void dwc3_ep0_do_control_setup(struct dwc3 *dwc,
813 const struct dwc3_event_depevt *event)
814{
815 dwc3_ep0_out_start(dwc);
816}
817
818static void __dwc3_ep0_do_control_data(struct dwc3 *dwc, 812static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
819 struct dwc3_ep *dep, struct dwc3_request *req) 813 struct dwc3_ep *dep, struct dwc3_request *req)
820{ 814{
@@ -926,50 +920,7 @@ static void dwc3_ep0_xfernotready(struct dwc3 *dwc,
926{ 920{
927 dwc->setup_packet_pending = true; 921 dwc->setup_packet_pending = true;
928 922
929 /*
930 * This part is very tricky: If we have just handled
931 * XferNotReady(Setup) and we're now expecting a
932 * XferComplete but, instead, we receive another
933 * XferNotReady(Setup), we should STALL and restart
934 * the state machine.
935 *
936 * In all other cases, we just continue waiting
937 * for the XferComplete event.
938 *
939 * We are a little bit unsafe here because we're
940 * not trying to ensure that last event was, indeed,
941 * XferNotReady(Setup).
942 *
943 * Still, we don't expect any condition where that
944 * should happen and, even if it does, it would be
945 * another error condition.
946 */
947 if (dwc->ep0_next_event == DWC3_EP0_COMPLETE) {
948 switch (event->status) {
949 case DEPEVT_STATUS_CONTROL_SETUP:
950 dev_vdbg(dwc->dev, "Unexpected XferNotReady(Setup)\n");
951 dwc3_ep0_stall_and_restart(dwc);
952 break;
953 case DEPEVT_STATUS_CONTROL_DATA:
954 /* FALLTHROUGH */
955 case DEPEVT_STATUS_CONTROL_STATUS:
956 /* FALLTHROUGH */
957 default:
958 dev_vdbg(dwc->dev, "waiting for XferComplete\n");
959 }
960
961 return;
962 }
963
964 switch (event->status) { 923 switch (event->status) {
965 case DEPEVT_STATUS_CONTROL_SETUP:
966 dev_vdbg(dwc->dev, "Control Setup\n");
967
968 dwc->ep0state = EP0_SETUP_PHASE;
969
970 dwc3_ep0_do_control_setup(dwc, event);
971 break;
972
973 case DEPEVT_STATUS_CONTROL_DATA: 924 case DEPEVT_STATUS_CONTROL_DATA:
974 dev_vdbg(dwc->dev, "Control Data\n"); 925 dev_vdbg(dwc->dev, "Control Data\n");
975 926