Re: [PATCH] usb: dwc3: add cancelled reason for dwc3 requests

From: Thinh Nguyen
Date: Thu Mar 25 2021 - 17:01:17 EST


Felipe Balbi wrote:
> Hi,
>
> Ray Chi <raychi@xxxxxxxxxx> writes:
>> diff --git a/drivers/usb/dwc3/gadget.h b/drivers/usb/dwc3/gadget.h
>> index 0cd281949970..a23e85bd3933 100644
>> --- a/drivers/usb/dwc3/gadget.h
>> +++ b/drivers/usb/dwc3/gadget.h
>> @@ -56,6 +56,12 @@ struct dwc3;
>>
>> /* Frame/Microframe Number Mask */
>> #define DWC3_FRNUMBER_MASK 0x3fff
>> +
>> +/* Cancel reason for dwc3 request */
>> +#define DWC3_REQUEST_DEQUEUED -ECONNRESET /* Request get dequeued */
>> +#define DWC3_REQUEST_DISCONNECTED -ESHUTDOWN /* Device is disconnected/disabled */
>> +#define DWC3_REQUEST_STALL -EPIPE /* Bus or protocol error */
>
> this is just obfuscation, pass the errors directly. Also, make sure
> these are documented in the API.
>

Note: we don't have documentation for error codes for gadget side, only
host. These are just the equivalent error codes from the host side.

What we currently have for host:
https://www.kernel.org/doc/html/latest/driver-api/usb/error-codes.html

Maybe someone can work on that in a separate patch.

Thanks,
Thinh