2017-11-03 18:28:30 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2009-04-28 10:52:22 +08:00
|
|
|
/*
|
|
|
|
* xHCI host controller driver
|
|
|
|
*
|
|
|
|
* Copyright (C) 2008 Intel Corp.
|
|
|
|
*
|
|
|
|
* Author: Sarah Sharp
|
|
|
|
* Some code borrowed from the Linux EHCI driver.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "xhci.h"
|
|
|
|
|
2010-01-05 04:20:17 +08:00
|
|
|
char *xhci_get_slot_state(struct xhci_hcd *xhci,
|
2009-12-10 07:59:13 +08:00
|
|
|
struct xhci_container_ctx *ctx)
|
|
|
|
{
|
|
|
|
struct xhci_slot_ctx *slot_ctx = xhci_get_slot_ctx(xhci, ctx);
|
2017-04-07 22:56:56 +08:00
|
|
|
int state = GET_SLOT_STATE(le32_to_cpu(slot_ctx->dev_state));
|
2009-12-10 07:59:13 +08:00
|
|
|
|
2017-04-07 22:56:56 +08:00
|
|
|
return xhci_slot_state_string(state);
|
2009-12-10 07:59:13 +08:00
|
|
|
}
|
|
|
|
|
2013-08-06 05:22:15 +08:00
|
|
|
void xhci_dbg_trace(struct xhci_hcd *xhci, void (*trace)(struct va_format *),
|
|
|
|
const char *fmt, ...)
|
|
|
|
{
|
|
|
|
struct va_format vaf;
|
|
|
|
va_list args;
|
|
|
|
|
|
|
|
va_start(args, fmt);
|
|
|
|
vaf.fmt = fmt;
|
|
|
|
vaf.va = &args;
|
|
|
|
xhci_dbg(xhci, "%pV\n", &vaf);
|
|
|
|
trace(&vaf);
|
|
|
|
va_end(args);
|
|
|
|
}
|
2014-10-03 16:35:28 +08:00
|
|
|
EXPORT_SYMBOL_GPL(xhci_dbg_trace);
|