#ifndef __LINUX_XHCI_HCD_H
#define __LINUX_XHCI_HCD_H
#include <linux/usb.h>
#include <linux/timer.h>
#include <linux/kernel.h>
#include <linux/usb/hcd.h>
#include <linux/io-64-nonatomic-lo-hi.h>
#include <linux/io-64-nonatomic-hi-lo.h>
#include "xhci-ext-caps.h"
#include "pci-quirks.h"
#include "xhci-port.h"
#include "xhci-caps.h"
#define XHCI_MSG_MAX …
#define XHCI_SBRN_OFFSET …
#define MAX_HC_SLOTS …
#define MAX_HC_PORTS …
struct xhci_cap_regs { … };
#define NUM_PORT_REGS …
#define PORTSC …
#define PORTPMSC …
#define PORTLI …
#define PORTHLPMC …
struct xhci_op_regs { … };
#define CMD_RUN …
#define CMD_RESET …
#define CMD_EIE …
#define CMD_HSEIE …
#define CMD_LRESET …
#define CMD_CSS …
#define CMD_CRS …
#define CMD_EWE …
#define CMD_PM_INDEX …
#define CMD_ETE …
#define XHCI_RESET_LONG_USEC …
#define XHCI_RESET_SHORT_USEC …
#define IMAN_IE …
#define IMAN_IP …
#define STS_HALT …
#define STS_FATAL …
#define STS_EINT …
#define STS_PORT …
#define STS_SAVE …
#define STS_RESTORE …
#define STS_SRE …
#define STS_CNR …
#define STS_HCE …
#define DEV_NOTE_MASK …
#define ENABLE_DEV_NOTE(x) …
#define DEV_NOTE_FWAKE …
#define CMD_RING_PAUSE …
#define CMD_RING_ABORT …
#define CMD_RING_RUNNING …
#define CMD_RING_RSVD_BITS …
#define MAX_DEVS(p) …
#define CONFIG_U3E …
#define CONFIG_CIE …
struct xhci_intr_reg { … };
#define ER_IRQ_PENDING(p) …
#define ER_IRQ_CLEAR(p) …
#define ER_IRQ_ENABLE(p) …
#define ER_IRQ_DISABLE(p) …
#define ER_IRQ_INTERVAL_MASK …
#define ER_IRQ_COUNTER_MASK …
#define ERST_SIZE_MASK …
#define ERST_BASE_RSVDP …
#define ERST_DESI_MASK …
#define ERST_EHB …
#define ERST_PTR_MASK …
struct xhci_run_regs { … };
struct xhci_doorbell_array { … };
#define DB_VALUE(ep, stream) …
#define DB_VALUE_HOST …
#define PLT_MASK …
#define PLT_SYM …
#define PLT_ASYM_RX …
#define PLT_ASYM_TX …
struct xhci_container_ctx { … };
struct xhci_slot_ctx { … };
#define ROUTE_STRING_MASK …
#define DEV_SPEED …
#define GET_DEV_SPEED(n) …
#define DEV_MTT …
#define DEV_HUB …
#define LAST_CTX_MASK …
#define LAST_CTX(p) …
#define LAST_CTX_TO_EP_NUM(p) …
#define SLOT_FLAG …
#define EP0_FLAG …
#define MAX_EXIT …
#define ROOT_HUB_PORT(p) …
#define DEVINFO_TO_ROOT_HUB_PORT(p) …
#define XHCI_MAX_PORTS(p) …
#define DEVINFO_TO_MAX_PORTS(p) …
#define TT_SLOT …
#define TT_PORT …
#define TT_THINK_TIME(p) …
#define GET_TT_THINK_TIME(p) …
#define DEV_ADDR_MASK …
#define SLOT_STATE …
#define GET_SLOT_STATE(p) …
#define SLOT_STATE_DISABLED …
#define SLOT_STATE_ENABLED …
#define SLOT_STATE_DEFAULT …
#define SLOT_STATE_ADDRESSED …
#define SLOT_STATE_CONFIGURED …
struct xhci_ep_ctx { … };
#define EP_STATE_MASK …
#define EP_STATE_DISABLED …
#define EP_STATE_RUNNING …
#define EP_STATE_HALTED …
#define EP_STATE_STOPPED …
#define EP_STATE_ERROR …
#define GET_EP_CTX_STATE(ctx) …
#define EP_MULT(p) …
#define CTX_TO_EP_MULT(p) …
#define EP_INTERVAL(p) …
#define EP_INTERVAL_TO_UFRAMES(p) …
#define CTX_TO_EP_INTERVAL(p) …
#define EP_MAXPSTREAMS_MASK …
#define EP_MAXPSTREAMS(p) …
#define CTX_TO_EP_MAXPSTREAMS(p) …
#define EP_HAS_LSA …
#define CTX_TO_MAX_ESIT_PAYLOAD_HI(p) …
#define FORCE_EVENT …
#define ERROR_COUNT(p) …
#define CTX_TO_EP_TYPE(p) …
#define EP_TYPE(p) …
#define ISOC_OUT_EP …
#define BULK_OUT_EP …
#define INT_OUT_EP …
#define CTRL_EP …
#define ISOC_IN_EP …
#define BULK_IN_EP …
#define INT_IN_EP …
#define MAX_BURST(p) …
#define CTX_TO_MAX_BURST(p) …
#define MAX_PACKET(p) …
#define MAX_PACKET_MASK …
#define MAX_PACKET_DECODED(p) …
#define EP_AVG_TRB_LENGTH(p) …
#define EP_MAX_ESIT_PAYLOAD_LO(p) …
#define EP_MAX_ESIT_PAYLOAD_HI(p) …
#define CTX_TO_MAX_ESIT_PAYLOAD(p) …
#define EP_CTX_CYCLE_MASK …
#define SCTX_DEQ_MASK …
struct xhci_input_control_ctx { … };
#define EP_IS_ADDED(ctrl_ctx, i) …
#define EP_IS_DROPPED(ctrl_ctx, i) …
struct xhci_command { … };
#define DROP_EP(x) …
#define ADD_EP(x) …
struct xhci_stream_ctx { … };
#define SCT_FOR_CTX(p) …
#define SCT_SEC_TR …
#define SCT_PRI_TR …
#define SCT_SSA_8 …
#define SCT_SSA_16 …
#define SCT_SSA_32 …
#define SCT_SSA_64 …
#define SCT_SSA_128 …
#define SCT_SSA_256 …
struct xhci_stream_info { … };
#define SMALL_STREAM_ARRAY_SIZE …
#define MEDIUM_STREAM_ARRAY_SIZE …
struct xhci_bw_info { … };
#define FS_BLOCK …
#define HS_BLOCK …
#define SS_BLOCK …
#define DMI_BLOCK …
#define DMI_OVERHEAD …
#define DMI_OVERHEAD_BURST …
#define SS_OVERHEAD …
#define SS_OVERHEAD_BURST …
#define HS_OVERHEAD …
#define FS_OVERHEAD …
#define LS_OVERHEAD …
#define TT_HS_OVERHEAD …
#define TT_DMI_OVERHEAD …
#define FS_BW_LIMIT …
#define TT_BW_LIMIT …
#define HS_BW_LIMIT …
#define SS_BW_LIMIT_IN …
#define DMI_BW_LIMIT_IN …
#define SS_BW_LIMIT_OUT …
#define DMI_BW_LIMIT_OUT …
#define FS_BW_RESERVED …
#define HS_BW_RESERVED …
#define SS_BW_RESERVED …
struct xhci_virt_ep { … };
enum xhci_overhead_type { … };
struct xhci_interval_bw { … };
#define XHCI_MAX_INTERVAL …
struct xhci_interval_bw_table { … };
#define EP_CTX_PER_DEV …
struct xhci_virt_device { … };
struct xhci_root_port_bw_info { … };
struct xhci_tt_bw_info { … };
struct xhci_device_context_array { … };
struct xhci_transfer_event { … };
#define TRB_TO_SLOT_ID(p) …
#define SLOT_ID_FOR_TRB(p) …
#define TRB_TO_EP_ID(p) …
#define EP_ID_FOR_TRB(p) …
#define TRB_TO_EP_INDEX(p) …
#define EP_INDEX_FOR_TRB(p) …
#define EVENT_TRB_LEN(p) …
#define COMP_CODE_MASK …
#define GET_COMP_CODE(p) …
#define COMP_INVALID …
#define COMP_SUCCESS …
#define COMP_DATA_BUFFER_ERROR …
#define COMP_BABBLE_DETECTED_ERROR …
#define COMP_USB_TRANSACTION_ERROR …
#define COMP_TRB_ERROR …
#define COMP_STALL_ERROR …
#define COMP_RESOURCE_ERROR …
#define COMP_BANDWIDTH_ERROR …
#define COMP_NO_SLOTS_AVAILABLE_ERROR …
#define COMP_INVALID_STREAM_TYPE_ERROR …
#define COMP_SLOT_NOT_ENABLED_ERROR …
#define COMP_ENDPOINT_NOT_ENABLED_ERROR …
#define COMP_SHORT_PACKET …
#define COMP_RING_UNDERRUN …
#define COMP_RING_OVERRUN …
#define COMP_VF_EVENT_RING_FULL_ERROR …
#define COMP_PARAMETER_ERROR …
#define COMP_BANDWIDTH_OVERRUN_ERROR …
#define COMP_CONTEXT_STATE_ERROR …
#define COMP_NO_PING_RESPONSE_ERROR …
#define COMP_EVENT_RING_FULL_ERROR …
#define COMP_INCOMPATIBLE_DEVICE_ERROR …
#define COMP_MISSED_SERVICE_ERROR …
#define COMP_COMMAND_RING_STOPPED …
#define COMP_COMMAND_ABORTED …
#define COMP_STOPPED …
#define COMP_STOPPED_LENGTH_INVALID …
#define COMP_STOPPED_SHORT_PACKET …
#define COMP_MAX_EXIT_LATENCY_TOO_LARGE_ERROR …
#define COMP_ISOCH_BUFFER_OVERRUN …
#define COMP_EVENT_LOST_ERROR …
#define COMP_UNDEFINED_ERROR …
#define COMP_INVALID_STREAM_ID_ERROR …
#define COMP_SECONDARY_BANDWIDTH_ERROR …
#define COMP_SPLIT_TRANSACTION_ERROR …
static inline const char *xhci_trb_comp_code_string(u8 status)
{ … }
struct xhci_link_trb { … };
#define LINK_TOGGLE …
struct xhci_event_cmd { … };
#define TRB_BSR …
#define TRB_DC …
#define TRB_TSP …
enum xhci_ep_reset_type { … };
#define TRB_TO_VF_INTR_TARGET(p) …
#define TRB_TO_VF_ID(p) …
#define TRB_TO_BELT(p) …
#define TRB_TO_DEV_SPEED(p) …
#define TRB_TO_PACKET_TYPE(p) …
#define TRB_TO_ROOTHUB_PORT(p) …
enum xhci_setup_dev { … };
#define SUSPEND_PORT_FOR_TRB(p) …
#define TRB_TO_SUSPEND_PORT(p) …
#define LAST_EP_INDEX …
#define TRB_TO_STREAM_ID(p) …
#define STREAM_ID_FOR_TRB(p) …
#define SCT_FOR_TRB(p) …
#define TRB_TC …
#define GET_PORT_ID(p) …
#define EVENT_DATA …
#define TRB_LEN(p) …
#define TRB_TD_SIZE(p) …
#define GET_TD_SIZE(p) …
#define TRB_TD_SIZE_TBC(p) …
#define TRB_INTR_TARGET(p) …
#define GET_INTR_TARGET(p) …
#define TRB_TBC(p) …
#define TRB_TLBPC(p) …
#define TRB_CYCLE …
#define TRB_ENT …
#define TRB_ISP …
#define TRB_NO_SNOOP …
#define TRB_CHAIN …
#define TRB_IOC …
#define TRB_IDT …
#define TRB_IDT_MAX_SIZE …
#define TRB_BEI …
#define TRB_DIR_IN …
#define TRB_TX_TYPE(p) …
#define TRB_DATA_OUT …
#define TRB_DATA_IN …
#define TRB_SIA …
#define TRB_FRAME_ID(p) …
#define TRB_CACHE_SIZE_HS …
#define TRB_CACHE_SIZE_SS …
struct xhci_generic_trb { … };
xhci_trb;
#define TRB_TYPE_BITMASK …
#define TRB_TYPE(p) …
#define TRB_FIELD_TO_TYPE(p) …
#define TRB_NORMAL …
#define TRB_SETUP …
#define TRB_DATA …
#define TRB_STATUS …
#define TRB_ISOC …
#define TRB_LINK …
#define TRB_EVENT_DATA …
#define TRB_TR_NOOP …
#define TRB_ENABLE_SLOT …
#define TRB_DISABLE_SLOT …
#define TRB_ADDR_DEV …
#define TRB_CONFIG_EP …
#define TRB_EVAL_CONTEXT …
#define TRB_RESET_EP …
#define TRB_STOP_RING …
#define TRB_SET_DEQ …
#define TRB_RESET_DEV …
#define TRB_FORCE_EVENT …
#define TRB_NEG_BANDWIDTH …
#define TRB_SET_LT …
#define TRB_GET_BW …
#define TRB_FORCE_HEADER …
#define TRB_CMD_NOOP …
#define TRB_TRANSFER …
#define TRB_COMPLETION …
#define TRB_PORT_STATUS …
#define TRB_BANDWIDTH_EVENT …
#define TRB_DOORBELL …
#define TRB_HC_EVENT …
#define TRB_DEV_NOTE …
#define TRB_MFINDEX_WRAP …
#define TRB_VENDOR_DEFINED_LOW …
#define TRB_NEC_CMD_COMP …
#define TRB_NEC_GET_FW …
static inline const char *xhci_trb_type_string(u8 type)
{ … }
#define TRB_TYPE_LINK(x) …
#define TRB_TYPE_LINK_LE32(x) …
#define TRB_TYPE_NOOP_LE32(x) …
#define NEC_FW_MINOR(p) …
#define NEC_FW_MAJOR(p) …
#define TRBS_PER_SEGMENT …
#define MAX_RSVD_CMD_TRBS …
#define TRB_SEGMENT_SIZE …
#define TRB_SEGMENT_SHIFT …
#define TRB_MAX_BUFF_SHIFT …
#define TRB_MAX_BUFF_SIZE …
#define TRB_BUFF_LEN_UP_TO_BOUNDARY(addr) …
#define MAX_SOFT_RETRY …
#define AVOID_BEI_INTERVAL_MIN …
#define AVOID_BEI_INTERVAL_MAX …
struct xhci_segment { … };
enum xhci_cancelled_td_status { … };
struct xhci_td { … };
#define XHCI_CMD_DEFAULT_TIMEOUT …
struct xhci_cd { … };
enum xhci_ring_type { … };
static inline const char *xhci_ring_type_string(enum xhci_ring_type type)
{ … }
struct xhci_ring { … };
struct xhci_erst_entry { … };
struct xhci_erst { … };
struct xhci_scratchpad { … };
struct urb_priv { … };
#define ERST_DEFAULT_SEGS …
#define POLL_TIMEOUT …
#define XHCI_STOP_EP_CMD_TIMEOUT …
struct s3_save { … };
struct dev_info { … };
struct xhci_bus_state { … };
struct xhci_interrupter { … };
#define XHCI_MAX_REXIT_TIMEOUT_MS …
struct xhci_port_cap { … };
struct xhci_port { … };
struct xhci_hub { … };
struct xhci_hcd { … };
struct xhci_driver_overrides { … };
#define XHCI_CFC_DELAY …
static inline struct xhci_hcd *hcd_to_xhci(struct usb_hcd *hcd)
{ … }
static inline struct usb_hcd *xhci_to_hcd(struct xhci_hcd *xhci)
{ … }
static inline struct usb_hcd *xhci_get_usb3_hcd(struct xhci_hcd *xhci)
{ … }
static inline bool xhci_hcd_is_usb3(struct usb_hcd *hcd)
{ … }
static inline bool xhci_has_one_roothub(struct xhci_hcd *xhci)
{ … }
#define xhci_dbg(xhci, fmt, args...) …
#define xhci_err(xhci, fmt, args...) …
#define xhci_warn(xhci, fmt, args...) …
#define xhci_info(xhci, fmt, args...) …
static inline u64 xhci_read_64(const struct xhci_hcd *xhci,
__le64 __iomem *regs)
{ … }
static inline void xhci_write_64(struct xhci_hcd *xhci,
const u64 val, __le64 __iomem *regs)
{ … }
static inline bool xhci_link_chain_quirk(struct xhci_hcd *xhci, enum xhci_ring_type type)
{ … }
char *xhci_get_slot_state(struct xhci_hcd *xhci,
struct xhci_container_ctx *ctx);
void xhci_dbg_trace(struct xhci_hcd *xhci, void (*trace)(struct va_format *),
const char *fmt, ...);
void xhci_mem_cleanup(struct xhci_hcd *xhci);
int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags);
void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id);
int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id, struct usb_device *udev, gfp_t flags);
int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev);
void xhci_copy_ep0_dequeue_into_input_ctx(struct xhci_hcd *xhci,
struct usb_device *udev);
unsigned int xhci_get_endpoint_index(struct usb_endpoint_descriptor *desc);
unsigned int xhci_last_valid_endpoint(u32 added_ctxs);
void xhci_endpoint_zero(struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev, struct usb_host_endpoint *ep);
void xhci_update_tt_active_eps(struct xhci_hcd *xhci,
struct xhci_virt_device *virt_dev,
int old_active_eps);
void xhci_clear_endpoint_bw_info(struct xhci_bw_info *bw_info);
void xhci_update_bw_info(struct xhci_hcd *xhci,
struct xhci_container_ctx *in_ctx,
struct xhci_input_control_ctx *ctrl_ctx,
struct xhci_virt_device *virt_dev);
void xhci_endpoint_copy(struct xhci_hcd *xhci,
struct xhci_container_ctx *in_ctx,
struct xhci_container_ctx *out_ctx,
unsigned int ep_index);
void xhci_slot_copy(struct xhci_hcd *xhci,
struct xhci_container_ctx *in_ctx,
struct xhci_container_ctx *out_ctx);
int xhci_endpoint_init(struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev,
struct usb_device *udev, struct usb_host_endpoint *ep,
gfp_t mem_flags);
struct xhci_ring *xhci_ring_alloc(struct xhci_hcd *xhci,
unsigned int num_segs, unsigned int cycle_state,
enum xhci_ring_type type, unsigned int max_packet, gfp_t flags);
void xhci_ring_free(struct xhci_hcd *xhci, struct xhci_ring *ring);
int xhci_ring_expansion(struct xhci_hcd *xhci, struct xhci_ring *ring,
unsigned int num_trbs, gfp_t flags);
void xhci_initialize_ring_info(struct xhci_ring *ring,
unsigned int cycle_state);
void xhci_free_endpoint_ring(struct xhci_hcd *xhci,
struct xhci_virt_device *virt_dev,
unsigned int ep_index);
struct xhci_stream_info *xhci_alloc_stream_info(struct xhci_hcd *xhci,
unsigned int num_stream_ctxs,
unsigned int num_streams,
unsigned int max_packet, gfp_t flags);
void xhci_free_stream_info(struct xhci_hcd *xhci,
struct xhci_stream_info *stream_info);
void xhci_setup_streams_ep_input_ctx(struct xhci_hcd *xhci,
struct xhci_ep_ctx *ep_ctx,
struct xhci_stream_info *stream_info);
void xhci_setup_no_streams_ep_input_ctx(struct xhci_ep_ctx *ep_ctx,
struct xhci_virt_ep *ep);
void xhci_free_device_endpoint_resources(struct xhci_hcd *xhci,
struct xhci_virt_device *virt_dev, bool drop_control_ep);
struct xhci_ring *xhci_dma_to_transfer_ring(
struct xhci_virt_ep *ep,
u64 address);
struct xhci_command *xhci_alloc_command(struct xhci_hcd *xhci,
bool allocate_completion, gfp_t mem_flags);
struct xhci_command *xhci_alloc_command_with_ctx(struct xhci_hcd *xhci,
bool allocate_completion, gfp_t mem_flags);
void xhci_urb_free_priv(struct urb_priv *urb_priv);
void xhci_free_command(struct xhci_hcd *xhci,
struct xhci_command *command);
struct xhci_container_ctx *xhci_alloc_container_ctx(struct xhci_hcd *xhci,
int type, gfp_t flags);
void xhci_free_container_ctx(struct xhci_hcd *xhci,
struct xhci_container_ctx *ctx);
struct xhci_interrupter *
xhci_create_secondary_interrupter(struct usb_hcd *hcd, unsigned int segs);
void xhci_remove_secondary_interrupter(struct usb_hcd
*hcd, struct xhci_interrupter *ir);
xhci_get_quirks_t;
int xhci_handshake(void __iomem *ptr, u32 mask, u32 done, u64 timeout_us);
int xhci_handshake_check_state(struct xhci_hcd *xhci, void __iomem *ptr,
u32 mask, u32 done, int usec, unsigned int exit_state);
void xhci_quiesce(struct xhci_hcd *xhci);
int xhci_halt(struct xhci_hcd *xhci);
int xhci_start(struct xhci_hcd *xhci);
int xhci_reset(struct xhci_hcd *xhci, u64 timeout_us);
int xhci_run(struct usb_hcd *hcd);
int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks);
void xhci_shutdown(struct usb_hcd *hcd);
void xhci_stop(struct usb_hcd *hcd);
void xhci_init_driver(struct hc_driver *drv,
const struct xhci_driver_overrides *over);
int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
struct usb_host_endpoint *ep);
int xhci_drop_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
struct usb_host_endpoint *ep);
int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev);
void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev);
int xhci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev,
struct usb_tt *tt, gfp_t mem_flags);
int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id);
int xhci_ext_cap_init(struct xhci_hcd *xhci);
int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup);
int xhci_resume(struct xhci_hcd *xhci, pm_message_t msg);
irqreturn_t xhci_irq(struct usb_hcd *hcd);
irqreturn_t xhci_msi_irq(int irq, void *hcd);
int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev);
int xhci_alloc_tt_info(struct xhci_hcd *xhci,
struct xhci_virt_device *virt_dev,
struct usb_device *hdev,
struct usb_tt *tt, gfp_t mem_flags);
dma_addr_t xhci_trb_virt_to_dma(struct xhci_segment *seg, union xhci_trb *trb);
struct xhci_segment *trb_in_td(struct xhci_hcd *xhci, struct xhci_td *td,
dma_addr_t suspect_dma, bool debug);
int xhci_is_vendor_info_code(struct xhci_hcd *xhci, unsigned int trb_comp_code);
void xhci_ring_cmd_db(struct xhci_hcd *xhci);
int xhci_queue_slot_control(struct xhci_hcd *xhci, struct xhci_command *cmd,
u32 trb_type, u32 slot_id);
int xhci_queue_address_device(struct xhci_hcd *xhci, struct xhci_command *cmd,
dma_addr_t in_ctx_ptr, u32 slot_id, enum xhci_setup_dev);
int xhci_queue_vendor_command(struct xhci_hcd *xhci, struct xhci_command *cmd,
u32 field1, u32 field2, u32 field3, u32 field4);
int xhci_queue_stop_endpoint(struct xhci_hcd *xhci, struct xhci_command *cmd,
int slot_id, unsigned int ep_index, int suspend);
int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
int slot_id, unsigned int ep_index);
int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
int slot_id, unsigned int ep_index);
int xhci_queue_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
int slot_id, unsigned int ep_index);
int xhci_queue_isoc_tx_prepare(struct xhci_hcd *xhci, gfp_t mem_flags,
struct urb *urb, int slot_id, unsigned int ep_index);
int xhci_queue_configure_endpoint(struct xhci_hcd *xhci,
struct xhci_command *cmd, dma_addr_t in_ctx_ptr, u32 slot_id,
bool command_must_succeed);
int xhci_queue_evaluate_context(struct xhci_hcd *xhci, struct xhci_command *cmd,
dma_addr_t in_ctx_ptr, u32 slot_id, bool command_must_succeed);
int xhci_queue_reset_ep(struct xhci_hcd *xhci, struct xhci_command *cmd,
int slot_id, unsigned int ep_index,
enum xhci_ep_reset_type reset_type);
int xhci_queue_reset_device(struct xhci_hcd *xhci, struct xhci_command *cmd,
u32 slot_id);
void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci, unsigned int slot_id,
unsigned int ep_index, unsigned int stream_id,
struct xhci_td *td);
void xhci_stop_endpoint_command_watchdog(struct timer_list *t);
void xhci_handle_command_timeout(struct work_struct *work);
void xhci_ring_ep_doorbell(struct xhci_hcd *xhci, unsigned int slot_id,
unsigned int ep_index, unsigned int stream_id);
void xhci_ring_doorbell_for_active_rings(struct xhci_hcd *xhci,
unsigned int slot_id,
unsigned int ep_index);
void xhci_cleanup_command_queue(struct xhci_hcd *xhci);
void inc_deq(struct xhci_hcd *xhci, struct xhci_ring *ring);
unsigned int count_trbs(u64 addr, u64 len);
void xhci_set_link_state(struct xhci_hcd *xhci, struct xhci_port *port,
u32 link_state);
void xhci_test_and_clear_bit(struct xhci_hcd *xhci, struct xhci_port *port,
u32 port_bit);
int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex,
char *buf, u16 wLength);
int xhci_hub_status_data(struct usb_hcd *hcd, char *buf);
int xhci_find_raw_port_number(struct usb_hcd *hcd, int port1);
struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd);
void xhci_hc_died(struct xhci_hcd *xhci);
#ifdef CONFIG_PM
int xhci_bus_suspend(struct usb_hcd *hcd);
int xhci_bus_resume(struct usb_hcd *hcd);
unsigned long xhci_get_resuming_ports(struct usb_hcd *hcd);
#else
#define xhci_bus_suspend …
#define xhci_bus_resume …
#define xhci_get_resuming_ports …
#endif
u32 xhci_port_state_to_neutral(u32 state);
void xhci_ring_device(struct xhci_hcd *xhci, int slot_id);
struct xhci_input_control_ctx *xhci_get_input_control_ctx(struct xhci_container_ctx *ctx);
struct xhci_slot_ctx *xhci_get_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx);
struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned int ep_index);
struct xhci_ring *xhci_triad_to_transfer_ring(struct xhci_hcd *xhci,
unsigned int slot_id, unsigned int ep_index,
unsigned int stream_id);
static inline struct xhci_ring *xhci_urb_to_transfer_ring(struct xhci_hcd *xhci,
struct urb *urb)
{ … }
static inline bool xhci_urb_suitable_for_idt(struct urb *urb)
{ … }
static inline char *xhci_slot_state_string(u32 state)
{ … }
static inline const char *xhci_decode_trb(char *str, size_t size,
u32 field0, u32 field1, u32 field2, u32 field3)
{ … }
static inline const char *xhci_decode_ctrl_ctx(char *str,
unsigned long drop, unsigned long add)
{ … }
static inline const char *xhci_decode_slot_context(char *str,
u32 info, u32 info2, u32 tt_info, u32 state)
{ … }
static inline const char *xhci_portsc_link_state_string(u32 portsc)
{ … }
static inline const char *xhci_decode_portsc(char *str, u32 portsc)
{ … }
static inline const char *xhci_decode_usbsts(char *str, u32 usbsts)
{ … }
static inline const char *xhci_decode_doorbell(char *str, u32 slot, u32 doorbell)
{ … }
static inline const char *xhci_ep_state_string(u8 state)
{ … }
static inline const char *xhci_ep_type_string(u8 type)
{ … }
static inline const char *xhci_decode_ep_context(char *str, u32 info,
u32 info2, u64 deq, u32 tx_info)
{ … }
#endif