aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/debug.h
diff options
context:
space:
mode:
authorFelipe Balbi <felipe.balbi@linux.intel.com>2016-09-26 06:23:34 -0400
committerFelipe Balbi <felipe.balbi@linux.intel.com>2016-10-31 05:17:34 -0400
commit43c96be1c46eb6ce292643f659221c7fca90bb84 (patch)
treee409c7b42b6060c55a8ee5f4c60a17d6101e6e1d /drivers/usb/dwc3/debug.h
parentcdd72ac20b4a769ad2aaf98223f853c719c5eda7 (diff)
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.h11
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)
200 * @event: then event code 200 * @event: then event code
201 */ 201 */
202static inline const char * 202static inline const char *
203dwc3_ep_event_string(const struct dwc3_event_depevt *event) 203dwc3_ep_event_string(const struct dwc3_event_depevt *event, u32 ep0state)
204{ 204{
205 u8 epnum = event->endpoint_number; 205 u8 epnum = event->endpoint_number;
206 static char str[256]; 206 static char str[256];
207 size_t len;
207 int status; 208 int status;
208 int ret; 209 int ret;
209 210
@@ -215,6 +216,10 @@ dwc3_ep_event_string(const struct dwc3_event_depevt *event)
215 switch (event->endpoint_event) { 216 switch (event->endpoint_event) {
216 case DWC3_DEPEVT_XFERCOMPLETE: 217 case DWC3_DEPEVT_XFERCOMPLETE:
217 strcat(str, "Transfer Complete"); 218 strcat(str, "Transfer Complete");
219 len = strlen(str);
220
221 if (epnum <= 1)
222 sprintf(str + len, " [%s]", dwc3_ep0_state_string(ep0state));
218 break; 223 break;
219 case DWC3_DEPEVT_XFERINPROGRESS: 224 case DWC3_DEPEVT_XFERINPROGRESS:
220 strcat(str, "Transfer In-Progress"); 225 strcat(str, "Transfer In-Progress");
@@ -299,14 +304,14 @@ static inline const char *dwc3_gadget_event_type_string(u8 event)
299 } 304 }
300} 305}
301 306
302static inline const char *dwc3_decode_event(u32 event) 307static inline const char *dwc3_decode_event(u32 event, u32 ep0state)
303{ 308{
304 const union dwc3_event evt = (union dwc3_event) event; 309 const union dwc3_event evt = (union dwc3_event) event;
305 310
306 if (evt.type.is_devspec) 311 if (evt.type.is_devspec)
307 return dwc3_gadget_event_string(&evt.devt); 312 return dwc3_gadget_event_string(&evt.devt);
308 else 313 else
309 return dwc3_ep_event_string(&evt.depevt); 314 return dwc3_ep_event_string(&evt.depevt, ep0state);
310} 315}
311 316
312static inline const char *dwc3_ep_cmd_status_string(int status) 317static inline const char *dwc3_ep_cmd_status_string(int status)