Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * xHCI host controller driver
0004  *
0005  * Copyright (C) 2008 Intel Corp.
0006  *
0007  * Author: Sarah Sharp
0008  * Some code borrowed from the Linux EHCI driver.
0009  */
0010 
0011 #include "xhci.h"
0012 
0013 char *xhci_get_slot_state(struct xhci_hcd *xhci,
0014         struct xhci_container_ctx *ctx)
0015 {
0016     struct xhci_slot_ctx *slot_ctx = xhci_get_slot_ctx(xhci, ctx);
0017     int state = GET_SLOT_STATE(le32_to_cpu(slot_ctx->dev_state));
0018 
0019     return xhci_slot_state_string(state);
0020 }
0021 
0022 void xhci_dbg_trace(struct xhci_hcd *xhci, void (*trace)(struct va_format *),
0023             const char *fmt, ...)
0024 {
0025     struct va_format vaf;
0026     va_list args;
0027 
0028     va_start(args, fmt);
0029     vaf.fmt = fmt;
0030     vaf.va = &args;
0031     xhci_dbg(xhci, "%pV\n", &vaf);
0032     trace(&vaf);
0033     va_end(args);
0034 }
0035 EXPORT_SYMBOL_GPL(xhci_dbg_trace);