aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorFelipe Balbi <felipe.balbi@linux.intel.com>2018-08-01 06:53:29 -0400
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-11-26 02:08:29 -0500
commitd5443bbf5fc8f8389cce146b1fc2987cdd229d12 (patch)
tree820ccda60260434a28c2f2b34e02f919a0f545f8 /drivers/usb/dwc3
parent7746a8dfb3f9c91b3a0b63a1d5c2664410e6498d (diff)
usb: dwc3: gadget: introduce cancelled_list
This list will host cancelled requests who still have TRBs being processed. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/core.h2
-rw-r--r--drivers/usb/dwc3/gadget.c1
-rw-r--r--drivers/usb/dwc3/gadget.h15
3 files changed, 18 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index 8405519413a4..9798c73c09ce 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -646,6 +646,7 @@ struct dwc3_event_buffer {
646/** 646/**
647 * struct dwc3_ep - device side endpoint representation 647 * struct dwc3_ep - device side endpoint representation
648 * @endpoint: usb endpoint 648 * @endpoint: usb endpoint
649 * @cancelled_list: list of cancelled requests for this endpoint
649 * @pending_list: list of pending requests for this endpoint 650 * @pending_list: list of pending requests for this endpoint
650 * @started_list: list of started requests on this endpoint 651 * @started_list: list of started requests on this endpoint
651 * @wait_end_transfer: wait_queue_head_t for waiting on End Transfer complete 652 * @wait_end_transfer: wait_queue_head_t for waiting on End Transfer complete
@@ -673,6 +674,7 @@ struct dwc3_event_buffer {
673 */ 674 */
674struct dwc3_ep { 675struct dwc3_ep {
675 struct usb_ep endpoint; 676 struct usb_ep endpoint;
677 struct list_head cancelled_list;
676 struct list_head pending_list; 678 struct list_head pending_list;
677 struct list_head started_list; 679 struct list_head started_list;
678 680
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 9728978070b7..17203944d77f 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2284,6 +2284,7 @@ static int dwc3_gadget_init_endpoint(struct dwc3 *dwc, u8 epnum)
2284 2284
2285 INIT_LIST_HEAD(&dep->pending_list); 2285 INIT_LIST_HEAD(&dep->pending_list);
2286 INIT_LIST_HEAD(&dep->started_list); 2286 INIT_LIST_HEAD(&dep->started_list);
2287 INIT_LIST_HEAD(&dep->cancelled_list);
2287 2288
2288 return 0; 2289 return 0;
2289} 2290}
diff --git a/drivers/usb/dwc3/gadget.h b/drivers/usb/dwc3/gadget.h
index 2aacd1afd9ff..023a473648eb 100644
--- a/drivers/usb/dwc3/gadget.h
+++ b/drivers/usb/dwc3/gadget.h
@@ -79,6 +79,21 @@ static inline void dwc3_gadget_move_started_request(struct dwc3_request *req)
79 list_move_tail(&req->list, &dep->started_list); 79 list_move_tail(&req->list, &dep->started_list);
80} 80}
81 81
82/**
83 * dwc3_gadget_move_cancelled_request - move @req to the cancelled_list
84 * @req: the request to be moved
85 *
86 * Caller should take care of locking. This function will move @req from its
87 * current list to the endpoint's cancelled_list.
88 */
89static inline void dwc3_gadget_move_cancelled_request(struct dwc3_request *req)
90{
91 struct dwc3_ep *dep = req->dep;
92
93 req->started = false;
94 list_move_tail(&req->list, &dep->cancelled_list);
95}
96
82void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req, 97void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req,
83 int status); 98 int status);
84 99