blob: 386abf26641d28f464ea62bf4722e7311b833e37 [file] [log] [blame]
Greg Kroah-Hartman5fd54ac2017-11-03 11:28:30 +01001// SPDX-License-Identifier: GPL-2.0
Sarah Sharp74c68742009-04-27 19:52:22 -07002/*
3 * xHCI host controller driver
4 *
5 * Copyright (C) 2008 Intel Corp.
6 *
7 * Author: Sarah Sharp
8 * Some code borrowed from the Linux EHCI driver.
Sarah Sharp74c68742009-04-27 19:52:22 -07009 */
10
11#include "xhci.h"
12
Sarah Sharp9c9a7dbf2010-01-04 12:20:17 -080013char *xhci_get_slot_state(struct xhci_hcd *xhci,
Sarah Sharp2a8f82c2009-12-09 15:59:13 -080014 struct xhci_container_ctx *ctx)
15{
16 struct xhci_slot_ctx *slot_ctx = xhci_get_slot_ctx(xhci, ctx);
Felipe Balbi52407722017-04-07 17:56:56 +030017 int state = GET_SLOT_STATE(le32_to_cpu(slot_ctx->dev_state));
Sarah Sharp2a8f82c2009-12-09 15:59:13 -080018
Felipe Balbi52407722017-04-07 17:56:56 +030019 return xhci_slot_state_string(state);
Sarah Sharp2a8f82c2009-12-09 15:59:13 -080020}
21
Xenia Ragiadakou84a99f62013-08-06 00:22:15 +030022void xhci_dbg_trace(struct xhci_hcd *xhci, void (*trace)(struct va_format *),
23 const char *fmt, ...)
24{
25 struct va_format vaf;
26 va_list args;
27
28 va_start(args, fmt);
29 vaf.fmt = fmt;
30 vaf.va = &args;
31 xhci_dbg(xhci, "%pV\n", &vaf);
32 trace(&vaf);
33 va_end(args);
34}
Andrew Bresticker436e8c72014-10-03 11:35:28 +030035EXPORT_SYMBOL_GPL(xhci_dbg_trace);