diff options
author | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-09-26 12:23:34 +0200 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-10-31 10:17:34 +0100 |
commit | 43c96be1c46eb6ce292643f659221c7fca90bb84 (patch) | |
tree | e409c7b42b6060c55a8ee5f4c60a17d6101e6e1d /drivers/usb/dwc3/debug.h | |
parent | usb: dwc3: debug: move dwc3_ep0_state_string() to debug.h (diff) | |
download | linux-43c96be1c46eb6ce292643f659221c7fca90bb84.tar.xz linux-43c96be1c46eb6ce292643f659221c7fca90bb84.zip |
usb: dwc3: trace: print out ep0state also from XferComplete
With this extra piece of information, it will be
easier to find mismatches between driver and HW.
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3/debug.h')
-rw-r--r-- | drivers/usb/dwc3/debug.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/usb/dwc3/debug.h b/drivers/usb/dwc3/debug.h index 61b6f0f207cf..b287fc6ab29e 100644 --- a/drivers/usb/dwc3/debug.h +++ b/drivers/usb/dwc3/debug.h @@ -200,10 +200,11 @@ dwc3_gadget_event_string(const struct dwc3_event_devt *event) * @event: then event code */ static inline const char * -dwc3_ep_event_string(const struct dwc3_event_depevt *event) +dwc3_ep_event_string(const struct dwc3_event_depevt *event, u32 ep0state) { u8 epnum = event->endpoint_number; static char str[256]; + size_t len; int status; int ret; @@ -215,6 +216,10 @@ dwc3_ep_event_string(const struct dwc3_event_depevt *event) switch (event->endpoint_event) { case DWC3_DEPEVT_XFERCOMPLETE: strcat(str, "Transfer Complete"); + len = strlen(str); + + if (epnum <= 1) + sprintf(str + len, " [%s]", dwc3_ep0_state_string(ep0state)); break; case DWC3_DEPEVT_XFERINPROGRESS: strcat(str, "Transfer In-Progress"); @@ -299,14 +304,14 @@ static inline const char *dwc3_gadget_event_type_string(u8 event) } } -static inline const char *dwc3_decode_event(u32 event) +static inline const char *dwc3_decode_event(u32 event, u32 ep0state) { const union dwc3_event evt = (union dwc3_event) event; if (evt.type.is_devspec) return dwc3_gadget_event_string(&evt.devt); else - return dwc3_ep_event_string(&evt.depevt); + return dwc3_ep_event_string(&evt.depevt, ep0state); } static inline const char *dwc3_ep_cmd_status_string(int status) |