2009-11-02 21:11:50 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* drivers/usbdev/usbdev_trprintf.c
|
|
|
|
*
|
2013-02-15 15:37:37 +01:00
|
|
|
* Copyright (C) 2008-2010, 2012-2013 Gregory Nutt. All rights reserved.
|
2012-01-24 22:51:26 +01:00
|
|
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
2009-11-02 21:11:50 +01:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in
|
|
|
|
* the documentation and/or other materials provided with the
|
|
|
|
* distribution.
|
|
|
|
* 3. Neither the name NuttX nor the names of its contributors may be
|
|
|
|
* used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
|
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
2009-12-15 15:25:14 +01:00
|
|
|
#include <stdint.h>
|
2009-11-02 21:11:50 +01:00
|
|
|
#include <debug.h>
|
|
|
|
|
2010-12-14 04:33:39 +01:00
|
|
|
#include <nuttx/usb/usbdev_trace.h>
|
2009-11-02 21:11:50 +01:00
|
|
|
|
|
|
|
/****************************************************************************
|
2014-03-18 16:31:02 +01:00
|
|
|
* Pre-processor Definitions
|
2009-11-02 21:11:50 +01:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Private Types
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Private Function Prototypes
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Private Data
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Private Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
2015-10-03 15:25:53 +02:00
|
|
|
/****************************************************************************
|
2013-09-07 01:24:02 +02:00
|
|
|
* Name: get_trstring
|
2013-02-15 15:37:37 +01:00
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Search the driver string data to find the string matching the provided ID.
|
|
|
|
*
|
2015-10-03 15:25:53 +02:00
|
|
|
****************************************************************************/
|
2013-02-15 15:37:37 +01:00
|
|
|
|
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
2013-09-07 01:24:02 +02:00
|
|
|
static FAR const char *get_trstring(FAR const struct trace_msg_t *array,
|
|
|
|
uint8_t id)
|
2013-02-15 15:37:37 +01:00
|
|
|
{
|
|
|
|
FAR const struct trace_msg_t *p = array;
|
|
|
|
while (p->str != NULL)
|
|
|
|
{
|
|
|
|
if (p->id == id)
|
|
|
|
{
|
|
|
|
return p->str;
|
|
|
|
}
|
|
|
|
p++;
|
|
|
|
}
|
2014-04-13 22:32:20 +02:00
|
|
|
|
2013-02-15 15:37:37 +01:00
|
|
|
return "???";
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-11-02 21:11:50 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
2015-10-03 15:25:53 +02:00
|
|
|
/****************************************************************************
|
2009-11-02 21:11:50 +01:00
|
|
|
* Name: usbtrace_trprintf
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Print the trace record using the supplied printing function
|
|
|
|
*
|
2015-10-03 15:25:53 +02:00
|
|
|
****************************************************************************/
|
2009-11-02 21:11:50 +01:00
|
|
|
|
2009-12-15 15:25:14 +01:00
|
|
|
void usbtrace_trprintf(trprintf_t trprintf, uint16_t event, uint16_t value)
|
2009-11-02 21:11:50 +01:00
|
|
|
{
|
|
|
|
switch (event)
|
|
|
|
{
|
|
|
|
case TRACE_DEVINIT:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "DCD initialize",
|
|
|
|
TRACE_DATA(event), "Initialized", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "DCD initialize",
|
|
|
|
TRACE_DATA(event), value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_DEVUNINIT:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "DCD un-initialize",
|
|
|
|
"Un-initialized", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "DCD un-initialize",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_DEVREGISTER:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "DCD register",
|
|
|
|
"Registered", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "DCD register",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_DEVUNREGISTER:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "DCD un-register",
|
|
|
|
"Un-registered", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "DCD un-register",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_EPCONFIGURE:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "EP configure",
|
|
|
|
"Endpoint configured", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "EP configure",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_EPDISABLE:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "EP disable",
|
|
|
|
"Endpoint disabled", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "EP disable",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_EPALLOCREQ:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "EP allocreq",
|
|
|
|
"Allocate endpoint request", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "EP allocreq",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_EPFREEREQ:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "EP freereq",
|
|
|
|
"Free endpoint request", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "EP freereq",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_EPALLOCBUFFER:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "EP allocbuffer",
|
|
|
|
"Allocate endpoint buffer", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "EP allocbuffer",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_EPFREEBUFFER:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "EP freebuffer",
|
|
|
|
"Free endpoint buffer", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "EP freebuffer",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_EPSUBMIT:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "EP submit",
|
|
|
|
"Submit endpoint request", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "EP submit",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_EPCANCEL:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "EP cancel",
|
|
|
|
"Cancel endpoint request", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "EP cancel",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_EPSTALL:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "EP stall",
|
|
|
|
"Stall endpoint", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "EP stall",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_EPRESUME:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "EP resume",
|
|
|
|
"Resume endpoint", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "EP resume",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_DEVALLOCEP:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "DCD allocep",
|
|
|
|
"Allocate endpoint", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "DCD allocep",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_DEVFREEEP:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "DCD freeep",
|
|
|
|
"Free endpoint", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "DCD freeep",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_DEVGETFRAME:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "DCD getframe",
|
|
|
|
"Get frame number", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "DCD getframe",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_DEVWAKEUP:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "DCD wakeup",
|
|
|
|
"Wakeup event", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "DCD wakeup",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_DEVSELFPOWERED:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "DCD selfpowered",
|
|
|
|
"Self-powered", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "DCD selfpowered",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_DEVPULLUP:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "DCD pullup",
|
|
|
|
"Soft connect", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "DCD pullup",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_CLASSBIND:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "Class bind",
|
|
|
|
"Bind class", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "Class bind",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_CLASSUNBIND:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "Class unbind",
|
|
|
|
"Un-bind class", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "Class unbind",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_CLASSDISCONNECT:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "Class disconnect",
|
|
|
|
"Disconnect class", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "Class disconnect",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_CLASSSETUP:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "Class setup",
|
|
|
|
"Class SETUP request", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "Class setup",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_CLASSSUSPEND:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "Class suspend",
|
|
|
|
"Suspend class", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "Class suspend",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_CLASSRESUME:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "Class resume",
|
|
|
|
"Resume class", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "Class resume",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_CLASSRDCOMPLETE:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "Class RD complete",
|
|
|
|
"Read request complete", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "Class RD complete",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_CLASSWRCOMPLETE:
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s : %-40s %04x\n", "Class RW complete",
|
|
|
|
"Write request complete", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s : %04x\n", "Class RW complete",
|
|
|
|
value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
switch (TRACE_ID(event))
|
|
|
|
{
|
|
|
|
case TRACE_CLASSAPI_ID: /* Other class driver system API calls */
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s %02x: %-40s %04x\n", "Class API call",
|
|
|
|
TRACE_DATA(event),
|
|
|
|
get_trstring(g_usb_trace_strings_clsapi, TRACE_DATA(event)),
|
|
|
|
value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s %02x: %04x\n", "Class API call",
|
|
|
|
TRACE_DATA(event), value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_CLASSSTATE_ID: /* Track class driver state changes */
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s %02x: %-40s %04x\n", "Class state",
|
|
|
|
TRACE_DATA(event),
|
|
|
|
get_trstring(g_usb_trace_strings_clsstate, TRACE_DATA(event)),
|
|
|
|
value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s %02x: %04x\n", "Class state",
|
|
|
|
TRACE_DATA(event), value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_INTENTRY_ID: /* Interrupt handler entry */
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s%3d: %-40s %04x\n", "Interrupt entry",
|
|
|
|
TRACE_DATA(event), "ENTRY", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s%3d: %04x\n", "Interrupt entry",
|
|
|
|
TRACE_DATA(event), value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_INTDECODE_ID: /* Decoded interrupt event */
|
2013-02-15 15:37:37 +01:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
2013-09-07 01:24:02 +02:00
|
|
|
trprintf("%-18s%3d: %-40s %04x\n", "Interrupt decode",
|
|
|
|
TRACE_DATA(event),
|
|
|
|
get_trstring(g_usb_trace_strings_intdecode, TRACE_DATA(event)),
|
2013-02-15 15:37:37 +01:00
|
|
|
value);
|
|
|
|
#else
|
2013-09-07 01:24:02 +02:00
|
|
|
trprintf("%-18s%3d: %04x\n", "Interrupt decode",
|
|
|
|
TRACE_DATA(event), value);
|
2013-02-15 15:37:37 +01:00
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_INTEXIT_ID: /* Interrupt handler exit */
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s%3d: %-40s %04x\n", "Interrupt exit",
|
|
|
|
TRACE_DATA(event), "EXIT", value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s%3d: %04x\n", "Interrupt exit",
|
|
|
|
TRACE_DATA(event), value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_OUTREQQUEUED_ID: /* Request queued for OUT endpoint */
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("EP%2d %-16s: %-40s %04x\n",
|
|
|
|
TRACE_DATA(event), "OUT queued",
|
|
|
|
"Read request queued", value);
|
|
|
|
#else
|
|
|
|
trprintf("EP%2d %-16s: %04x\n",
|
|
|
|
TRACE_DATA(event), "OUT queued", value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_INREQQUEUED_ID: /* Request queued for IN endpoint */
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("EP%2d %-16s: %-40s %04x\n",
|
|
|
|
TRACE_DATA(event), "IN queued",
|
|
|
|
"Write request queued", value);
|
|
|
|
#else
|
|
|
|
trprintf("EP%2d %-16s: %04x\n",
|
|
|
|
TRACE_DATA(event), "IN queued", value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_READ_ID: /* Read (OUT) action */
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("EP%2d %-16s: %-40s %04x\n",
|
|
|
|
TRACE_DATA(event), "OUT read",
|
|
|
|
"Incoming data read", value);
|
|
|
|
#else
|
|
|
|
trprintf("EP%2d %-16s: %04x\n",
|
|
|
|
TRACE_DATA(event), "OUT read", value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_WRITE_ID: /* Write (IN) action */
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("EP%2d %-16s: %-40s %04x\n",
|
|
|
|
TRACE_DATA(event), "IN write",
|
|
|
|
"Outgoing data written", value);
|
|
|
|
#else
|
|
|
|
trprintf("EP%2d %-16s: %04x\n",
|
|
|
|
TRACE_DATA(event), "IN write", value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_COMPLETE_ID: /* Request completed */
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("EP%2d %-16s: %-40s %04x\n",
|
|
|
|
TRACE_DATA(event), "Request complete",
|
|
|
|
"Request completed", value);
|
|
|
|
#else
|
|
|
|
trprintf("EP%2d %-16s: %04x\n",
|
|
|
|
TRACE_DATA(event), "Request complete", value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_DEVERROR_ID: /* USB controller driver error event */
|
2013-02-15 15:37:37 +01:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
2013-09-07 01:24:02 +02:00
|
|
|
trprintf("%-18s %02x: %-40s %04x\n", "Controller error",
|
|
|
|
TRACE_DATA(event),
|
|
|
|
get_trstring(g_usb_trace_strings_deverror, TRACE_DATA(event)),
|
2013-02-15 15:37:37 +01:00
|
|
|
value);
|
|
|
|
#else
|
2013-09-07 01:24:02 +02:00
|
|
|
trprintf("%-18s %02x: %04x\n", "Controller error",
|
|
|
|
TRACE_DATA(event),
|
|
|
|
value);
|
2013-02-15 15:37:37 +01:00
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_CLSERROR_ID: /* USB class driver error event */
|
2013-09-07 01:24:02 +02:00
|
|
|
#ifdef CONFIG_USBDEV_TRACE_STRINGS
|
|
|
|
trprintf("%-18s %02x: %-40s %04x\n", "Class error",
|
|
|
|
TRACE_DATA(event),
|
|
|
|
get_trstring(g_usb_trace_strings_clserror, TRACE_DATA(event)),
|
|
|
|
value);
|
|
|
|
#else
|
|
|
|
trprintf("%-18s %02x: %04x\n", "Class error",
|
|
|
|
TRACE_DATA(event), value);
|
|
|
|
#endif
|
2009-11-02 21:11:50 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2013-09-07 01:24:02 +02:00
|
|
|
trprintf("Unrecognized event : %02x:%02x:%04x\n",
|
2009-11-02 21:11:50 +01:00
|
|
|
TRACE_ID(event) >> 8, TRACE_DATA(event), value);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|