Greg Kroah-Hartman | 5fd54ac | 2017-11-03 11:28:30 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Sarah Sharp | 74c6874 | 2009-04-27 19:52:22 -0700 | [diff] [blame] | 2 | /* |
| 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 Sharp | 74c6874 | 2009-04-27 19:52:22 -0700 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #include "xhci.h" |
| 12 | |
Sarah Sharp | 9c9a7dbf | 2010-01-04 12:20:17 -0800 | [diff] [blame] | 13 | char *xhci_get_slot_state(struct xhci_hcd *xhci, |
Sarah Sharp | 2a8f82c | 2009-12-09 15:59:13 -0800 | [diff] [blame] | 14 | struct xhci_container_ctx *ctx) |
| 15 | { |
| 16 | struct xhci_slot_ctx *slot_ctx = xhci_get_slot_ctx(xhci, ctx); |
Felipe Balbi | 5240772 | 2017-04-07 17:56:56 +0300 | [diff] [blame] | 17 | int state = GET_SLOT_STATE(le32_to_cpu(slot_ctx->dev_state)); |
Sarah Sharp | 2a8f82c | 2009-12-09 15:59:13 -0800 | [diff] [blame] | 18 | |
Felipe Balbi | 5240772 | 2017-04-07 17:56:56 +0300 | [diff] [blame] | 19 | return xhci_slot_state_string(state); |
Sarah Sharp | 2a8f82c | 2009-12-09 15:59:13 -0800 | [diff] [blame] | 20 | } |
| 21 | |
Xenia Ragiadakou | 84a99f6 | 2013-08-06 00:22:15 +0300 | [diff] [blame] | 22 | void 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 Bresticker | 436e8c7 | 2014-10-03 11:35:28 +0300 | [diff] [blame] | 35 | EXPORT_SYMBOL_GPL(xhci_dbg_trace); |