diff options
author | Ray Chi <raychi@google.com> | 2021-03-28 02:17:42 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-04-02 15:27:36 +0200 |
commit | 04dd6e76b228891d29e49759e2351eb4a4303fc9 (patch) | |
tree | 48f181afb4f7f84d4328e3da83eccfd3544a2daa /drivers/usb/dwc3/gadget.h | |
parent | d1689cd3c0f449de92d9ec13707dfea1f96c3dbd (diff) | |
download | linux-stable-04dd6e76b228891d29e49759e2351eb4a4303fc9.tar.gz linux-stable-04dd6e76b228891d29e49759e2351eb4a4303fc9.tar.bz2 linux-stable-04dd6e76b228891d29e49759e2351eb4a4303fc9.zip |
usb: dwc3: add cancelled reasons for dwc3 requests
Currently, when dwc3 handles request cancelled, dwc3 just returns
-ECONNRESET for all requests. It will cause USB function drivers
can't know if the requests are cancelled by other reasons.
This patch will replace DWC3_REQUEST_STATUS_CANCELLED with the
reasons below.
- DWC3_REQUEST_STATUS_DISCONNECTED
- DWC3_REQUEST_STATUS_DEQUEUED
- DWC3_REQUEST_STATUS_STALLED
Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Ray Chi <raychi@google.com>
Link: https://lore.kernel.org/r/20210327181742.1810969-1-raychi@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/dwc3/gadget.h')
-rw-r--r-- | drivers/usb/dwc3/gadget.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/gadget.h b/drivers/usb/dwc3/gadget.h index 0cd281949970..77df4b6d6c13 100644 --- a/drivers/usb/dwc3/gadget.h +++ b/drivers/usb/dwc3/gadget.h @@ -90,15 +90,17 @@ static inline void dwc3_gadget_move_started_request(struct dwc3_request *req) /** * dwc3_gadget_move_cancelled_request - move @req to the cancelled_list * @req: the request to be moved + * @reason: cancelled reason for the dwc3 request * * Caller should take care of locking. This function will move @req from its * current list to the endpoint's cancelled_list. */ -static inline void dwc3_gadget_move_cancelled_request(struct dwc3_request *req) +static inline void dwc3_gadget_move_cancelled_request(struct dwc3_request *req, + unsigned int reason) { struct dwc3_ep *dep = req->dep; - req->status = DWC3_REQUEST_STATUS_CANCELLED; + req->status = reason; list_move_tail(&req->list, &dep->cancelled_list); } |