Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+18
+2
drivers/usb/dwc3/core.h
··· 646 646 /** 647 647 * struct dwc3_ep - device side endpoint representation 648 648 * @endpoint: usb endpoint 649 + * @cancelled_list: list of cancelled requests for this endpoint 649 650 * @pending_list: list of pending requests for this endpoint 650 651 * @started_list: list of started requests on this endpoint 651 652 * @wait_end_transfer: wait_queue_head_t for waiting on End Transfer complete ··· 674 673 */ 675 674 struct dwc3_ep { 676 675 struct usb_ep endpoint; 676 + struct list_head cancelled_list; 677 677 struct list_head pending_list; 678 678 struct list_head started_list; 679 679
+1
drivers/usb/dwc3/gadget.c
··· 2284 2284 2285 2285 INIT_LIST_HEAD(&dep->pending_list); 2286 2286 INIT_LIST_HEAD(&dep->started_list); 2287 + INIT_LIST_HEAD(&dep->cancelled_list); 2287 2288 2288 2289 return 0; 2289 2290 }
+15
drivers/usb/dwc3/gadget.h
··· 79 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 + */ 89 + static 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 + 82 97 void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req, 83 98 int status); 84 99