Lines Matching full:xhci
4 * xHCI host controller driver
22 /* Code sharing between pci-quirks and xhci hcd */
23 #include "xhci-ext-caps.h"
26 #include "xhci-port.h"
27 #include "xhci-caps.h"
32 /* xHCI PCI Configuration Registers */
41 * xHCI register interface.
42 * This corresponds to the eXtensible Host Controller Interface (xHCI)
47 * struct xhci_cap_regs - xHCI Host Controller Capability Registers.
55 * @hcc_params2: HCCPARAMS2 Capability Parameters 2, xhci 1.1 only
65 __le32 hcc_params2; /* xhci 1.1 */
78 * struct xhci_op_regs - xHCI Host Controller Operational Registers.
127 * The xHCI driver must reinitialize the xHC after setting this bit.
208 /* bit 8: U3 Entry Enabled, assert PLC when root port enters U3, xhci 1.1 */
210 /* bit 9: Configuration Information Enable, xhci 1.1 */
539 /* xHCI command response timeout in milliseconds */
588 /* Some Intel xHCI host controllers need software to keep track of the bus
675 struct xhci_hcd *xhci; member
750 * See xhci 1.1 section 4.8.3 for more details
1021 /* xhci 1.1 uses the TD_SIZE field for TBC if Extended TBC is enabled (ETE) */
1026 /* Total burst count field, Rsvdz on xhci 1.1 with Extended TBC enabled (ETE) */
1300 * xHCI command default timeout value in milliseconds.
1359 unsigned int num_trbs_free; /* used only by xhci DbC */
1377 /* xhci->event_ring keeps track of segment dma addresses */
1443 * Intel Lynx Point LP xHCI host.
1554 * halt the xHCI host, and complete all URBs with an -ESHUTDOWN code. Any code
1557 * they see this status (any time they drop and re-acquire xhci->lock).
1561 * There are no reports of xHCI host controllers that display this issue.
1633 /* support xHCI 1.0 spec USB2 hardware LPM */
1658 /* Platform specific overrides to generic XHCI hc_driver ops */
1690 static inline struct usb_hcd *xhci_to_hcd(struct xhci_hcd *xhci) in xhci_to_hcd() argument
1692 return xhci->main_hcd; in xhci_to_hcd()
1695 static inline struct usb_hcd *xhci_get_usb3_hcd(struct xhci_hcd *xhci) in xhci_get_usb3_hcd() argument
1697 if (xhci->shared_hcd) in xhci_get_usb3_hcd()
1698 return xhci->shared_hcd; in xhci_get_usb3_hcd()
1700 if (!xhci->usb2_rhub.num_ports) in xhci_get_usb3_hcd()
1701 return xhci->main_hcd; in xhci_get_usb3_hcd()
1708 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_hcd_is_usb3() local
1710 return hcd == xhci_get_usb3_hcd(xhci); in xhci_hcd_is_usb3()
1713 static inline bool xhci_has_one_roothub(struct xhci_hcd *xhci) in xhci_has_one_roothub() argument
1715 return xhci->allow_single_roothub && in xhci_has_one_roothub()
1716 (!xhci->usb2_rhub.num_ports || !xhci->usb3_rhub.num_ports); in xhci_has_one_roothub()
1719 #define xhci_dbg(xhci, fmt, args...) \ argument
1720 dev_dbg(xhci_to_hcd(xhci)->self.controller , fmt , ## args)
1721 #define xhci_err(xhci, fmt, args...) \ argument
1722 dev_err(xhci_to_hcd(xhci)->self.controller , fmt , ## args)
1723 #define xhci_warn(xhci, fmt, args...) \ argument
1724 dev_warn(xhci_to_hcd(xhci)->self.controller , fmt , ## args)
1725 #define xhci_info(xhci, fmt, args...) \ argument
1726 dev_info(xhci_to_hcd(xhci)->self.controller , fmt , ## args)
1731 * Some xHCI implementations may support 64-bit address pointers. Registers
1734 * xHCI implementations that do not support 64-bit address pointers will ignore
1737 static inline u64 xhci_read_64(const struct xhci_hcd *xhci, in xhci_read_64() argument
1742 static inline void xhci_write_64(struct xhci_hcd *xhci, in xhci_write_64() argument
1750 static inline bool xhci_link_chain_quirk(struct xhci_hcd *xhci, enum xhci_ring_type type) in xhci_link_chain_quirk() argument
1752 return (xhci->quirks & XHCI_LINK_TRB_QUIRK) || in xhci_link_chain_quirk()
1753 (type == TYPE_ISOC && (xhci->quirks & XHCI_AMD_0x96_HOST)); in xhci_link_chain_quirk()
1756 /* xHCI debugging */
1757 char *xhci_get_slot_state(struct xhci_hcd *xhci,
1759 void xhci_dbg_trace(struct xhci_hcd *xhci, void (*trace)(struct va_format *),
1762 /* xHCI memory management */
1763 void xhci_mem_cleanup(struct xhci_hcd *xhci);
1764 int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags);
1765 void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id);
1766 int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id, struct usb_device *udev, gfp_t flags…
1767 int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev);
1768 void xhci_copy_ep0_dequeue_into_input_ctx(struct xhci_hcd *xhci,
1772 void xhci_endpoint_zero(struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev, struct usb_host_e…
1773 void xhci_update_tt_active_eps(struct xhci_hcd *xhci,
1777 void xhci_update_bw_info(struct xhci_hcd *xhci,
1781 void xhci_endpoint_copy(struct xhci_hcd *xhci,
1785 void xhci_slot_copy(struct xhci_hcd *xhci,
1788 int xhci_endpoint_init(struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev,
1791 struct xhci_ring *xhci_ring_alloc(struct xhci_hcd *xhci,
1794 void xhci_ring_free(struct xhci_hcd *xhci, struct xhci_ring *ring);
1795 int xhci_ring_expansion(struct xhci_hcd *xhci, struct xhci_ring *ring,
1799 void xhci_free_endpoint_ring(struct xhci_hcd *xhci,
1802 struct xhci_stream_info *xhci_alloc_stream_info(struct xhci_hcd *xhci,
1806 void xhci_free_stream_info(struct xhci_hcd *xhci,
1808 void xhci_setup_streams_ep_input_ctx(struct xhci_hcd *xhci,
1813 void xhci_free_device_endpoint_resources(struct xhci_hcd *xhci,
1818 struct xhci_command *xhci_alloc_command(struct xhci_hcd *xhci,
1820 struct xhci_command *xhci_alloc_command_with_ctx(struct xhci_hcd *xhci,
1823 void xhci_free_command(struct xhci_hcd *xhci,
1825 struct xhci_container_ctx *xhci_alloc_container_ctx(struct xhci_hcd *xhci,
1827 void xhci_free_container_ctx(struct xhci_hcd *xhci,
1835 /* xHCI host controller glue */
1838 int xhci_handshake_check_state(struct xhci_hcd *xhci, void __iomem *ptr,
1840 void xhci_quiesce(struct xhci_hcd *xhci);
1841 int xhci_halt(struct xhci_hcd *xhci);
1842 int xhci_start(struct xhci_hcd *xhci);
1843 int xhci_reset(struct xhci_hcd *xhci, u64 timeout_us);
1858 int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id);
1859 int xhci_ext_cap_init(struct xhci_hcd *xhci);
1861 int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup);
1862 int xhci_resume(struct xhci_hcd *xhci, pm_message_t msg);
1867 int xhci_alloc_tt_info(struct xhci_hcd *xhci,
1874 /* xHCI ring, segment, TRB, and TD functions */
1876 struct xhci_segment *trb_in_td(struct xhci_hcd *xhci, struct xhci_td *td,
1878 int xhci_is_vendor_info_code(struct xhci_hcd *xhci, unsigned int trb_comp_code);
1879 void xhci_ring_cmd_db(struct xhci_hcd *xhci);
1880 int xhci_queue_slot_control(struct xhci_hcd *xhci, struct xhci_command *cmd,
1882 int xhci_queue_address_device(struct xhci_hcd *xhci, struct xhci_command *cmd,
1884 int xhci_queue_vendor_command(struct xhci_hcd *xhci, struct xhci_command *cmd,
1886 int xhci_queue_stop_endpoint(struct xhci_hcd *xhci, struct xhci_command *cmd,
1888 int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
1890 int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
1892 int xhci_queue_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
1894 int xhci_queue_isoc_tx_prepare(struct xhci_hcd *xhci, gfp_t mem_flags,
1896 int xhci_queue_configure_endpoint(struct xhci_hcd *xhci,
1899 int xhci_queue_evaluate_context(struct xhci_hcd *xhci, struct xhci_command *cmd,
1901 int xhci_queue_reset_ep(struct xhci_hcd *xhci, struct xhci_command *cmd,
1904 int xhci_queue_reset_device(struct xhci_hcd *xhci, struct xhci_command *cmd,
1908 void xhci_ring_ep_doorbell(struct xhci_hcd *xhci, unsigned int slot_id,
1910 void xhci_ring_doorbell_for_active_rings(struct xhci_hcd *xhci,
1913 void xhci_cleanup_command_queue(struct xhci_hcd *xhci);
1914 void inc_deq(struct xhci_hcd *xhci, struct xhci_ring *ring);
1917 /* xHCI roothub code */
1918 void xhci_set_link_state(struct xhci_hcd *xhci, struct xhci_port *port,
1920 void xhci_test_and_clear_bit(struct xhci_hcd *xhci, struct xhci_port *port,
1927 enum usb_link_tunnel_mode xhci_port_is_tunneled(struct xhci_hcd *xhci,
1929 void xhci_hc_died(struct xhci_hcd *xhci);
1942 void xhci_ring_device(struct xhci_hcd *xhci, int slot_id);
1944 /* xHCI contexts */
1946 struct xhci_slot_ctx *xhci_get_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx);
1947 struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned…
1949 struct xhci_ring *xhci_triad_to_transfer_ring(struct xhci_hcd *xhci,
1953 static inline struct xhci_ring *xhci_urb_to_transfer_ring(struct xhci_hcd *xhci, in xhci_urb_to_transfer_ring() argument
1956 return xhci_triad_to_transfer_ring(xhci, urb->dev->slot_id, in xhci_urb_to_transfer_ring()