Lines Matching defs:xhci
3 * xhci-debugfs.c - xHCI debugfs interface
13 #include "xhci.h"
14 #include "xhci-debugfs.h"
86 static struct xhci_regset *xhci_debugfs_alloc_regset(struct xhci_hcd *xhci)
99 list_add_tail(®set->list, &xhci->regset_list);
114 static void xhci_debugfs_regset(struct xhci_hcd *xhci, u32 base,
122 struct usb_hcd *hcd = xhci_to_hcd(xhci);
124 rgs = xhci_debugfs_alloc_regset(xhci);
141 static void xhci_debugfs_extcap_regset(struct xhci_hcd *xhci, int cap_id,
148 void __iomem *base = &xhci->cap_regs->hc_capbase;
157 xhci_debugfs_regset(xhci, offset, regs, nregs,
158 xhci->debugfs_root, "%s:%02d",
261 struct xhci_hcd *xhci;
267 xhci = hcd_to_xhci(bus_to_hcd(dev->udev->bus));
268 slot_ctx = xhci_get_slot_ctx(xhci, dev->out_ctx);
283 struct xhci_hcd *xhci;
289 xhci = hcd_to_xhci(bus_to_hcd(dev->udev->bus));
292 ep_ctx = xhci_get_ep_ctx(xhci, dev->out_ctx, ep_index);
293 dma = dev->out_ctx->dma + (ep_index + 1) * CTX_SIZE(xhci->hcc_params);
368 struct xhci_hcd *xhci = hcd_to_xhci(port->rhub->hcd);
378 if (!HCC2_CTC(xhci->hcc_params2))
380 spin_lock_irqsave(&xhci->lock, flags);
384 spin_unlock_irqrestore(&xhci->lock, flags);
391 spin_unlock_irqrestore(&xhci->lock, flags);
406 static void xhci_debugfs_create_files(struct xhci_hcd *xhci,
418 static struct dentry *xhci_debugfs_create_ring_dir(struct xhci_hcd *xhci,
426 xhci_debugfs_create_files(xhci, ring_files, ARRAY_SIZE(ring_files),
432 static void xhci_debugfs_create_context_files(struct xhci_hcd *xhci,
436 struct xhci_virt_device *dev = xhci->devs[slot_id];
438 xhci_debugfs_create_files(xhci, context_files,
444 void xhci_debugfs_create_endpoint(struct xhci_hcd *xhci,
464 epriv->root = xhci_debugfs_create_ring_dir(xhci,
471 void xhci_debugfs_remove_endpoint(struct xhci_hcd *xhci,
567 void xhci_debugfs_create_stream_files(struct xhci_hcd *xhci,
592 void xhci_debugfs_create_slot(struct xhci_hcd *xhci, int slot_id)
595 struct xhci_virt_device *dev = xhci->devs[slot_id];
602 priv->root = debugfs_create_dir(priv->name, xhci->debugfs_slots);
606 xhci_debugfs_create_ring_dir(xhci, &dev->eps[0].ring,
609 xhci_debugfs_create_context_files(xhci, priv->root, slot_id);
612 void xhci_debugfs_remove_slot(struct xhci_hcd *xhci, int slot_id)
616 struct xhci_virt_device *dev = xhci->devs[slot_id];
632 static void xhci_debugfs_create_ports(struct xhci_hcd *xhci,
640 num_ports = HCS_MAX_PORTS(xhci->hcs_params1);
648 port = &xhci->hw_ports[num_ports];
653 void xhci_debugfs_init(struct xhci_hcd *xhci)
655 struct device *dev = xhci_to_hcd(xhci)->self.controller;
657 xhci->debugfs_root = debugfs_create_dir(dev_name(dev),
660 INIT_LIST_HEAD(&xhci->regset_list);
662 xhci_debugfs_regset(xhci,
665 xhci->debugfs_root, "reg-cap");
667 xhci_debugfs_regset(xhci,
668 HC_LENGTH(readl(&xhci->cap_regs->hc_capbase)),
670 xhci->debugfs_root, "reg-op");
672 xhci_debugfs_regset(xhci,
673 readl(&xhci->cap_regs->run_regs_off) & RTSOFF_MASK,
675 xhci->debugfs_root, "reg-runtime");
677 xhci_debugfs_extcap_regset(xhci, XHCI_EXT_CAPS_LEGACY,
682 xhci_debugfs_extcap_regset(xhci, XHCI_EXT_CAPS_PROTOCOL,
687 xhci_debugfs_extcap_regset(xhci, XHCI_EXT_CAPS_DEBUG,
692 xhci_debugfs_create_ring_dir(xhci, &xhci->cmd_ring,
694 xhci->debugfs_root);
696 xhci_debugfs_create_ring_dir(xhci, &xhci->event_ring,
698 xhci->debugfs_root);
700 xhci->debugfs_slots = debugfs_create_dir("devices", xhci->debugfs_root);
702 xhci_debugfs_create_ports(xhci, xhci->debugfs_root);
705 void xhci_debugfs_exit(struct xhci_hcd *xhci)
709 debugfs_remove_recursive(xhci->debugfs_root);
710 xhci->debugfs_root = NULL;
711 xhci->debugfs_slots = NULL;
713 list_for_each_entry_safe(rgs, tmp, &xhci->regset_list, list)
719 xhci_debugfs_root = debugfs_create_dir("xhci", usb_debug_root);