FreeBSD kernel usb device Code
|
#include <sys/stdint.h>
#include <sys/stddef.h>
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/types.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/bus.h>
#include <sys/module.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/condvar.h>
#include <sys/sysctl.h>
#include <sys/sx.h>
#include <sys/unistd.h>
#include <sys/callout.h>
#include <sys/malloc.h>
#include <sys/priv.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usb_core.h>
#include <dev/usb/usb_debug.h>
#include <dev/usb/usb_busdma.h>
#include <dev/usb/usb_process.h>
#include <dev/usb/usb_transfer.h>
#include <dev/usb/usb_device.h>
#include <dev/usb/usb_hub.h>
#include <dev/usb/usb_util.h>
#include <dev/usb/usb_controller.h>
#include <dev/usb/usb_bus.h>
#include <dev/usb/controller/xhci.h>
#include <dev/usb/controller/xhcireg.h>
Go to the source code of this file.
Data Structures | |
struct | xhci_std_temp |
Macros | |
#define | USB_DEBUG_VAR xhcidebug |
#define | XHCI_BUS2SC(bus) __containerof(bus, struct xhci_softc, sc_bus) |
#define | XHCI_GET_CTX(sc, which, field, ptr) |
#define | xhciroute 0 |
#define | xhcidma32 0 |
#define | xhcictlstep 0 |
#define | XHCI_INTR_ENDPT 1 |
#define | HSETW(ptr, val) ptr = { (uint8_t)(val), (uint8_t)((val) >> 8) } |
#define | C(x, y) ((x) | ((y) << 8)) |
Functions | |
static | SYSCTL_NODE (_hw_usb, OID_AUTO, xhci, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "USB XHCI") |
SYSCTL_INT (_hw_usb_xhci, OID_AUTO, streams, CTLFLAG_RWTUN, &xhcistreams, 0, "Set to enable streams mode support") | |
SYSCTL_INT (_hw_usb_xhci, OID_AUTO, ctlquirk, CTLFLAG_RWTUN, &xhcictlquirk, 0, "Set to enable control endpoint quirk") | |
SYSCTL_INT (_hw_usb_xhci, OID_AUTO, dcepquirk, CTLFLAG_RWTUN, &xhcidcepquirk, 0, "Set to disable endpoint deconfigure command") | |
static void | xhci_do_poll (struct usb_bus *) |
static void | xhci_device_done (struct usb_xfer *, usb_error_t) |
static void | xhci_root_intr (struct xhci_softc *) |
static void | xhci_free_device_ext (struct usb_device *) |
static struct xhci_endpoint_ext * | xhci_get_endpoint_ext (struct usb_device *, struct usb_endpoint_descriptor *) |
static usb_error_t | xhci_configure_device (struct usb_device *) |
static usb_error_t | xhci_configure_endpoint (struct usb_device *, struct usb_endpoint_descriptor *, struct xhci_endpoint_ext *, uint16_t, uint8_t, uint8_t, uint8_t, uint16_t, uint16_t, uint8_t) |
static usb_error_t | xhci_configure_mask (struct usb_device *, uint32_t, uint8_t) |
static usb_error_t | xhci_cmd_evaluate_ctx (struct xhci_softc *, uint64_t, uint8_t) |
static void | xhci_endpoint_doorbell (struct usb_xfer *) |
uint8_t | xhci_use_polling (void) |
static void | xhci_iterate_hw_softc (struct usb_bus *bus, usb_bus_mem_sub_cb_t *cb) |
static int | xhci_reset_command_queue_locked (struct xhci_softc *sc) |
usb_error_t | xhci_start_controller (struct xhci_softc *sc) |
usb_error_t | xhci_halt_controller (struct xhci_softc *sc) |
usb_error_t | xhci_reset_controller (struct xhci_softc *sc) |
usb_error_t | xhci_init (struct xhci_softc *sc, device_t self, uint8_t dma32) |
void | xhci_uninit (struct xhci_softc *sc) |
static void | xhci_set_hw_power_sleep (struct usb_bus *bus, uint32_t state) |
static usb_error_t | xhci_generic_done_sub (struct usb_xfer *xfer) |
static void | xhci_generic_done (struct usb_xfer *xfer) |
static void | xhci_activate_transfer (struct usb_xfer *xfer) |
static void | xhci_skip_transfer (struct usb_xfer *xfer) |
static void | xhci_check_transfer (struct xhci_softc *sc, struct xhci_trb *trb) |
static int | xhci_check_command (struct xhci_softc *sc, struct xhci_trb *trb) |
static int | xhci_interrupt_poll (struct xhci_softc *sc) |
static usb_error_t | xhci_do_command (struct xhci_softc *sc, struct xhci_trb *trb, uint16_t timeout_ms) |
static usb_error_t | xhci_cmd_enable_slot (struct xhci_softc *sc, uint8_t *pslot) |
static usb_error_t | xhci_cmd_disable_slot (struct xhci_softc *sc, uint8_t slot_id) |
static usb_error_t | xhci_cmd_set_address (struct xhci_softc *sc, uint64_t input_ctx, uint8_t bsr, uint8_t slot_id) |
static usb_error_t | xhci_set_address (struct usb_device *udev, struct mtx *mtx, uint16_t address) |
static usb_error_t | xhci_cmd_configure_ep (struct xhci_softc *sc, uint64_t input_ctx, uint8_t deconfigure, uint8_t slot_id) |
static usb_error_t | xhci_cmd_reset_ep (struct xhci_softc *sc, uint8_t preserve, uint8_t ep_id, uint8_t slot_id) |
static usb_error_t | xhci_cmd_set_tr_dequeue_ptr (struct xhci_softc *sc, uint64_t dequeue_ptr, uint16_t stream_id, uint8_t ep_id, uint8_t slot_id) |
static usb_error_t | xhci_cmd_stop_ep (struct xhci_softc *sc, uint8_t suspend, uint8_t ep_id, uint8_t slot_id) |
static usb_error_t | xhci_cmd_reset_dev (struct xhci_softc *sc, uint8_t slot_id) |
void | xhci_interrupt (struct xhci_softc *sc) |
static void | xhci_timeout (void *arg) |
static void | xhci_setup_generic_chain_sub (struct xhci_std_temp *temp) |
static void | xhci_setup_generic_chain (struct usb_xfer *xfer) |
static void | xhci_set_slot_pointer (struct xhci_softc *sc, uint8_t index, uint64_t dev_addr) |
static usb_error_t | xhci_configure_endpoint_by_xfer (struct usb_xfer *xfer) |
static usb_error_t | xhci_alloc_device_ext (struct usb_device *udev) |
static void | xhci_transfer_remove (struct usb_xfer *xfer, usb_error_t error) |
static usb_error_t | xhci_transfer_insert (struct usb_xfer *xfer) |
static void | xhci_device_generic_open (struct usb_xfer *xfer) |
static void | xhci_device_generic_close (struct usb_xfer *xfer) |
static void | xhci_device_generic_multi_enter (struct usb_endpoint *ep, usb_stream_t stream_id, struct usb_xfer *enter_xfer) |
static void | xhci_device_generic_enter (struct usb_xfer *xfer) |
static void | xhci_device_generic_start (struct usb_xfer *xfer) |
static usb_error_t | xhci_roothub_exec (struct usb_device *udev, struct usb_device_request *req, const void **pptr, uint16_t *plength) |
static void | xhci_xfer_setup (struct usb_setup_params *parm) |
static uint8_t | xhci_get_endpoint_state (struct usb_device *udev, uint8_t epno) |
static usb_error_t | xhci_configure_reset_endpoint (struct usb_xfer *xfer) |
static void | xhci_xfer_unsetup (struct usb_xfer *xfer) |
static void | xhci_start_dma_delay (struct usb_xfer *xfer) |
static void | xhci_configure_msg (struct usb_proc_msg *pm) |
static void | xhci_ep_init (struct usb_device *udev, struct usb_endpoint_descriptor *edesc, struct usb_endpoint *ep) |
static void | xhci_ep_uninit (struct usb_device *udev, struct usb_endpoint *ep) |
static void | xhci_ep_clear_stall (struct usb_device *udev, struct usb_endpoint *ep) |
static usb_error_t | xhci_device_init (struct usb_device *udev) |
static void | xhci_device_uninit (struct usb_device *udev) |
static void | xhci_get_dma_delay (struct usb_device *udev, uint32_t *pus) |
static void | xhci_device_resume (struct usb_device *udev) |
static void | xhci_device_suspend (struct usb_device *udev) |
static void | xhci_set_hw_power (struct usb_bus *bus) |
static void | xhci_device_state_change (struct usb_device *udev) |
static usb_error_t | xhci_set_endpoint_mode (struct usb_device *udev, struct usb_endpoint *ep, uint8_t ep_mode) |
Variables | |
static int | xhcistreams |
static int | xhcictlquirk = 1 |
static int | xhcidcepquirk |
static usb_proc_callback_t | xhci_configure_msg |
static const struct usb_bus_methods | xhci_bus_methods |
static const struct usb_pipe_methods | xhci_device_generic_methods |
static const struct usb_device_descriptor | xhci_devd |
static const struct xhci_bos_desc | xhci_bosd |
static const struct xhci_config_desc | xhci_confd |
static const struct usb_hub_ss_descriptor | xhci_hubd |
#define C | ( | x, | |
y | |||
) | ((x) | ((y) << 8)) |
#define XHCI_BUS2SC | ( | bus | ) | __containerof(bus, struct xhci_softc, sc_bus) |
#define XHCI_GET_CTX | ( | sc, | |
which, | |||
field, | |||
ptr | |||
) |
SYSCTL_INT | ( | _hw_usb_xhci | , |
OID_AUTO | , | ||
ctlquirk | , | ||
CTLFLAG_RWTUN | , | ||
& | xhcictlquirk, | ||
0 | , | ||
"Set to enable control endpoint quirk" | |||
) |
SYSCTL_INT | ( | _hw_usb_xhci | , |
OID_AUTO | , | ||
dcepquirk | , | ||
CTLFLAG_RWTUN | , | ||
& | xhcidcepquirk, | ||
0 | , | ||
"Set to disable endpoint deconfigure command" | |||
) |
SYSCTL_INT | ( | _hw_usb_xhci | , |
OID_AUTO | , | ||
streams | , | ||
CTLFLAG_RWTUN | , | ||
& | xhcistreams, | ||
0 | , | ||
"Set to enable streams mode support" | |||
) |
|
static |
|
static |
Definition at line 803 of file xhci.c.
References xhci_trb::dwTrb3, xhci_td::page_cache, usb_xfer::td_transfer_cache, xhci_td::td_trb, usb_pc_cpu_flush(), usb_pc_cpu_invalidate(), xhci_endpoint_doorbell(), and XHCI_TRB_3_CYCLE_BIT.
Referenced by xhci_check_transfer().
|
static |
Definition at line 2663 of file xhci.c.
References addr, usb_page_search::buffer, usb_device::bus, usb_device::controller_slot_id, xhci_hw_dev::device_pc, xhci_hw_dev::device_pg, xhci_hw_softc::devs, xhci_trb::dwTrb2, xhci_trb::dwTrb3, xhci_hw_dev::endpoint_pc, xhci_hw_dev::endpoint_pg, error, index, xhci_hw_dev::input_pc, xhci_hw_dev::input_pg, xhci_trb::qwTrb0, xhci_softc::sc_bus, xhci_softc::sc_ctx_is_64_byte, xhci_softc::sc_hw, usb_page_cache::tag_parent, USB_ERR_NOMEM, usb_pc_alloc_mem(), usb_pc_cpu_flush(), usbd_get_page(), XHCI_BUS2SC, xhci_free_device_ext(), XHCI_MAX_ENDPOINTS, XHCI_MAX_TRANSFERS, XHCI_PAGE_SIZE, xhci_set_slot_pointer(), XHCI_TRB_2_IRQ_SET, XHCI_TRB_3_CYCLE_BIT, XHCI_TRB_3_TYPE_SET, XHCI_TRB_ALIGN, and XHCI_TRB_TYPE_LINK.
Referenced by xhci_device_init().
|
static |
Definition at line 1019 of file xhci.c.
References DPRINTF, xhci_trb::dwTrb2, xhci_trb::dwTrb3, xhci_trb::qwTrb0, xhci_softc::sc_cmd_addr, xhci_softc::sc_cmd_cv, and xhci_softc::sc_cmd_result.
Referenced by xhci_interrupt_poll().
|
static |
Definition at line 854 of file xhci.c.
References usb_xfer_flags_int::control_xfr, xhci_hw_softc::devs, DPRINTF, xhci_trb::dwTrb2, xhci_trb::dwTrb3, xhci_hw_dev::endp, usb_xfer::flags_int, index, usb_xfer_flags_int::isochronous_xfr, xhci_td::len, xhci_td::ntrb, offset, xhci_td::page_cache, xhci_trb::qwTrb0, remainder, xhci_td::remainder, xhci_softc::sc_hw, xhci_softc::sc_noslot, usb_xfer_flags_int::short_frames_ok, status, xhci_td::status, xhci_td::td_self, usb_xfer::td_transfer_cache, usb_xfer::td_transfer_last, xhci_td::td_trb, xhci_endpoint_ext::trb, xhci_endpoint_ext::trb_ep_mode, USB_EP_MODE_STREAMS, usb_pc_cpu_flush(), usb_pc_cpu_invalidate(), xhci_endpoint_ext::xfer, xhci_activate_transfer(), xhci_generic_done(), XHCI_MAX_ENDPOINTS, XHCI_MAX_TRANSFERS, xhci_skip_transfer(), XHCI_TRB_2_BYTES_GET, XHCI_TRB_2_ERROR_GET, XHCI_TRB_2_REM_GET, XHCI_TRB_3_EP_GET, XHCI_TRB_3_SLOT_GET, XHCI_TRB_ERROR_SHORT_PKT, and XHCI_TRB_ERROR_SUCCESS.
Referenced by xhci_interrupt_poll().
|
static |
Definition at line 1471 of file xhci.c.
References DPRINTF, xhci_trb::dwTrb2, xhci_trb::dwTrb3, xhci_trb::qwTrb0, xhci_softc::sc_no_deconfigure, xhci_do_command(), XHCI_TRB_3_DCEP_BIT, XHCI_TRB_3_SLOT_SET, XHCI_TRB_3_TYPE_SET, XHCI_TRB_TYPE_CONFIGURE_EP, and xhcidcepquirk.
Referenced by xhci_configure_reset_endpoint(), and xhci_device_state_change().
|
static |
Definition at line 1303 of file xhci.c.
References DPRINTF, xhci_trb::dwTrb2, xhci_trb::dwTrb3, xhci_trb::qwTrb0, xhci_do_command(), XHCI_TRB_3_SLOT_SET, XHCI_TRB_3_TYPE_SET, and XHCI_TRB_TYPE_DISABLE_SLOT.
Referenced by xhci_device_uninit().
|
static |
Definition at line 1278 of file xhci.c.
References DPRINTF, xhci_trb::dwTrb2, xhci_trb::dwTrb3, xhci_trb::qwTrb0, xhci_do_command(), XHCI_TRB_3_SLOT_GET, XHCI_TRB_3_TYPE_SET, and XHCI_TRB_TYPE_ENABLE_SLOT.
Referenced by xhci_device_init().
|
static |
Definition at line 1496 of file xhci.c.
References DPRINTF, xhci_trb::dwTrb2, xhci_trb::dwTrb3, xhci_trb::qwTrb0, xhci_do_command(), XHCI_TRB_3_SLOT_SET, XHCI_TRB_3_TYPE_SET, and XHCI_TRB_TYPE_EVALUATE_CTX.
Referenced by xhci_configure_reset_endpoint(), and xhci_device_state_change().
|
static |
Definition at line 1582 of file xhci.c.
References DPRINTF, xhci_trb::dwTrb2, xhci_trb::dwTrb3, xhci_trb::qwTrb0, xhci_do_command(), XHCI_TRB_3_SLOT_SET, XHCI_TRB_3_TYPE_SET, and XHCI_TRB_TYPE_RESET_DEVICE.
Referenced by xhci_device_state_change().
|
static |
Definition at line 1514 of file xhci.c.
References DPRINTF, xhci_trb::dwTrb2, xhci_trb::dwTrb3, xhci_trb::qwTrb0, xhci_do_command(), XHCI_TRB_3_EP_SET, XHCI_TRB_3_PRSV_BIT, XHCI_TRB_3_SLOT_SET, XHCI_TRB_3_TYPE_SET, and XHCI_TRB_TYPE_RESET_EP.
Referenced by xhci_configure_reset_endpoint().
|
static |
Definition at line 1321 of file xhci.c.
References DPRINTF, xhci_trb::dwTrb2, xhci_trb::dwTrb3, xhci_trb::qwTrb0, xhci_do_command(), XHCI_TRB_3_BSR_BIT, XHCI_TRB_3_SLOT_SET, XHCI_TRB_3_TYPE_SET, and XHCI_TRB_TYPE_ADDRESS_DEVICE.
Referenced by xhci_set_address().
|
static |
Definition at line 1537 of file xhci.c.
References DPRINTF, xhci_trb::dwTrb2, xhci_trb::dwTrb3, xhci_trb::qwTrb0, xhci_do_command(), XHCI_TRB_2_STREAM_SET, XHCI_TRB_3_EP_SET, XHCI_TRB_3_SLOT_SET, XHCI_TRB_3_TYPE_SET, and XHCI_TRB_TYPE_SET_TR_DEQUEUE.
Referenced by xhci_configure_reset_endpoint().
|
static |
Definition at line 1559 of file xhci.c.
References DPRINTF, xhci_trb::dwTrb2, xhci_trb::dwTrb3, xhci_trb::qwTrb0, xhci_do_command(), XHCI_TRB_3_EP_SET, XHCI_TRB_3_SLOT_SET, XHCI_TRB_3_SUSP_EP_BIT, XHCI_TRB_3_TYPE_SET, and XHCI_TRB_TYPE_STOP_EP.
Referenced by xhci_configure_reset_endpoint(), and xhci_device_suspend().
|
static |
Definition at line 2511 of file xhci.c.
References usb_device_descriptor::bDeviceProtocol, usb_page_search::buffer, usb_device::bus, xhci_hw_dev::context_num, usb_device::controller_slot_id, ctx_slot, usb_device::ddesc, usb_device::depth, xhci_hw_softc::devs, DPRINTF, usb_device::hs_port_no, index, xhci_hw_dev::input_pc, xhci_hw_dev::nports, usb_device::parent_hs_hub, usb_device::parent_hub, usb_device::port_no, xhci_softc::sc_hw, slot, usb_device::speed, xhci_hw_dev::tt, UDPROTO_HSHUBMTT, usb_pc_cpu_flush(), USB_SPEED_FULL, USB_SPEED_HIGH, USB_SPEED_LOW, USB_SPEED_SUPER, usbd_get_page(), XHCI_BUS2SC, XHCI_GET_CTX, XHCI_SCTX_0_CTX_NUM_SET, XHCI_SCTX_0_HUB_SET, XHCI_SCTX_0_MTT_SET, XHCI_SCTX_0_ROUTE_SET, XHCI_SCTX_0_SPEED_SET, XHCI_SCTX_1_NUM_PORTS_SET, XHCI_SCTX_1_RH_PORT_SET, XHCI_SCTX_2_IRQ_TARGET_SET, XHCI_SCTX_2_TT_HUB_SID_SET, XHCI_SCTX_2_TT_PORT_NUM_SET, XHCI_SCTX_2_TT_THINK_TIME_SET, XHCI_SCTX_3_DEV_ADDR_SET, and XHCI_SCTX_3_SLOT_STATE_SET.
Referenced by xhci_device_state_change(), and xhci_set_address().
|
static |
Definition at line 2308 of file xhci.c.
References usb_endpoint_descriptor::bEndpointAddress, usb_endpoint_descriptor::bmAttributes, usb_page_search::buffer, usb_device::bus, usb_device::controller_slot_id, ctx_ep, xhci_hw_softc::devs, xhci_endp_ctx::dwEpCtx0, xhci_endp_ctx::dwEpCtx1, xhci_endp_ctx::dwEpCtx4, index, xhci_hw_dev::input_pc, xhci_endpoint_ext::page_cache, xhci_endpoint_ext::physaddr, xhci_endp_ctx::qwEpCtx2, xhci_softc::sc_hw, usb_device::speed, xhci_endpoint_ext::trb_ep_maxp, xhci_endpoint_ext::trb_ep_mode, type, UE_BULK, UE_CONTROL, UE_DIR_IN, UE_INTERRUPT, UE_ISOCHRONOUS, UE_XFERTYPE, USB_EP_MODE_STREAMS, USB_ERR_BAD_BUFSIZE, USB_ERR_NO_PIPE, usb_pc_cpu_flush(), USB_SPEED_FULL, USB_SPEED_LOW, USB_SPEED_SUPER, usbd_get_page(), usb_endpoint_descriptor::wMaxPacketSize, XHCI_BUS2SC, XHCI_EPCTX_0_EPSTATE_SET, XHCI_EPCTX_0_IVAL_SET, XHCI_EPCTX_0_LSA_SET, XHCI_EPCTX_0_MAXP_STREAMS_SET, XHCI_EPCTX_0_MULT_SET, XHCI_EPCTX_1_CERR_SET, XHCI_EPCTX_1_EPTYPE_SET, XHCI_EPCTX_1_HID_SET, XHCI_EPCTX_1_MAXB_SET, XHCI_EPCTX_1_MAXP_SIZE_SET, XHCI_EPCTX_2_DCS_SET, XHCI_EPCTX_4_AVG_TRB_LEN_SET, XHCI_EPCTX_4_MAX_ESIT_PAYLOAD_SET, XHCI_EPNO2EPID, XHCI_GET_CTX, XHCI_MAX_TRANSFERS, and XHCI_PAGE_SIZE.
Referenced by xhci_configure_endpoint_by_xfer(), and xhci_set_address().
|
static |
Definition at line 2468 of file xhci.c.
References usb_endpoint_ss_comp_descriptor::bmAttributes, dwTrb2, dwTrb3, xhci_trb::dwTrb3, usb_endpoint::ecomp, usb_endpoint::edesc, usb_xfer::endpoint, usb_endpoint::ep_mode, usb_xfer::interval, usb_xfer::max_frame_size, usb_xfer::max_packet_count, usb_xfer::max_packet_size, xhci_endpoint_ext::page_cache, xhci_endpoint_ext::physaddr, qwTrb0, xhci_endpoint_ext::trb, usb_xfer_root::udev, UE_GET_SS_ISO_MULT, usb_pc_cpu_flush(), usbd_xfer_get_fps_shift(), xhci_configure_endpoint(), xhci_get_endpoint_ext(), XHCI_MAX_TRANSFERS, XHCI_SCTX_0_SCT_SEC_TR_RING, and usb_xfer::xroot.
Referenced by xhci_configure_reset_endpoint().
|
static |
Definition at line 2250 of file xhci.c.
References usb_page_search::buffer, usb_device::bus, xhci_hw_dev::context_num, usb_device::controller_slot_id, ctx_slot, xhci_hw_softc::devs, xhci_input_ctx::dwInCtx0, xhci_input_ctx::dwInCtx1, index, xhci_hw_dev::input_pc, xhci_softc::sc_hw, slot, usb_pc_cpu_flush(), usbd_get_page(), XHCI_BUS2SC, XHCI_GET_CTX, XHCI_INCTX_NON_CTRL_MASK, and XHCI_SCTX_0_CTX_NUM_SET.
Referenced by xhci_configure_reset_endpoint(), xhci_device_state_change(), and xhci_set_address().
|
static |
Definition at line 3882 of file xhci.c.
References bus, usb_xfer_flags_int::did_dma_delay, usb_endpoint::edesc, usb_xfer::endpoint, usb_xfer::flags_int, usb_bus::intr_q, xhci_softc::sc_bus, usb_xfer::stream_id, xhci_endpoint_ext::trb_halted, xhci_endpoint_ext::trb_index, xhci_endpoint_ext::trb_running, usb_xfer_root::udev, USB_BUS_LOCK, USB_BUS_UNLOCK, usb_dma_delay_done_cb(), USB_ERR_TIMEOUT, usbd_transfer_dequeue(), xhci_endpoint_ext::xfer, XHCI_BUS2SC, xhci_configure_reset_endpoint(), xhci_device_done(), xhci_device_generic_multi_enter(), xhci_get_endpoint_ext(), XHCI_MAX_TRANSFERS, xhci_transfer_insert(), and usb_xfer::xroot.
|
static |
Definition at line 3762 of file xhci.c.
References usb_endpoint_descriptor::bEndpointAddress, usb_endpoint_descriptor::bmAttributes, usb_xfer_root::bus, usb_device::controller_slot_id, xhci_hw_softc::devs, DPRINTF, usb_endpoint::edesc, usb_xfer::endpoint, xhci_hw_dev::ep_configured, index, xhci_hw_dev::input_pc, xhci_endpoint_ext::physaddr, xhci_softc::sc_hw, usb_xfer::stream_id, usb_xfer_root::udev, UE_CONTROL, UE_DIR_IN, UE_XFERTYPE, USB_ERR_NO_PIPE, usbd_get_page(), XHCI_BUS2SC, xhci_cmd_configure_ep(), xhci_cmd_evaluate_ctx(), XHCI_CMD_LOCK, xhci_cmd_reset_ep(), xhci_cmd_set_tr_dequeue_ptr(), xhci_cmd_stop_ep(), XHCI_CMD_UNLOCK, xhci_configure_endpoint_by_xfer(), xhci_configure_mask(), XHCI_EPCTX_0_EPSTATE_DISABLED, XHCI_EPCTX_0_EPSTATE_HALTED, XHCI_EPCTX_0_EPSTATE_STOPPED, XHCI_EPCTX_2_DCS_SET, XHCI_EPNO2EPID, xhci_get_endpoint_ext(), xhci_get_endpoint_state(), XHCI_MAX_TRANSFERS, and usb_xfer::xroot.
Referenced by xhci_configure_msg().
|
static |
Definition at line 3007 of file xhci.c.
References usb_xfer::endpoint, error, usbd_transfer_done(), and xhci_transfer_remove().
Referenced by xhci_configure_msg(), xhci_device_generic_close(), xhci_generic_done(), and xhci_timeout().
|
static |
Definition at line 3029 of file xhci.c.
References DPRINTF, USB_ERR_CANCELLED, and xhci_device_done().
|
static |
Definition at line 3073 of file xhci.c.
References DPRINTF, usb_xfer::endpoint, usb_xfer::stream_id, xhci_device_generic_multi_enter(), and xhci_setup_generic_chain().
|
static |
Definition at line 3037 of file xhci.c.
References usb_xfer_flags_int::bandwidth_reclaimed, usb_xfer_queue::curr, usb_endpoint::endpoint_q, usb_xfer::flags_int, usb_xfer::stream_id, and xhci_transfer_insert().
Referenced by xhci_configure_msg(), xhci_device_generic_enter(), and xhci_device_generic_start().
|
static |
|
static |
Definition at line 3085 of file xhci.c.
References usb_xfer_root::bus, DPRINTF, usb_xfer::endpoint, usb_bus::intr_q, usb_xfer::stream_id, usb_xfer::timeout, usbd_transfer_enqueue(), usbd_transfer_timeout_ms(), xhci_device_generic_multi_enter(), xhci_timeout(), xhci_transfer_insert(), and usb_xfer::xroot.
|
static |
Definition at line 4031 of file xhci.c.
References usb_device::bus, usb_device::controller_slot_id, xhci_hw_softc::devs, DPRINTF, usb_device::parent_hub, xhci_softc::sc_hw, xhci_softc::sc_noslot, xhci_hw_dev::state, USB_ERR_BAD_ADDRESS, xhci_alloc_device_ext(), XHCI_BUS2SC, xhci_cmd_enable_slot(), XHCI_CMD_LOCK, XHCI_CMD_UNLOCK, xhci_set_address(), XHCI_ST_DISABLED, and XHCI_ST_ENABLED.
|
static |
Definition at line 4127 of file xhci.c.
References usb_device::bus, usb_device::controller_slot_id, DPRINTF, index, n, usb_device::parent_hub, USB_BUS_LOCK, USB_BUS_UNLOCK, XHCI_BUS2SC, XHCI_CMD_LOCK, XHCI_CMD_UNLOCK, XHCI_DB_SID_SET, XHCI_DOORBELL, XHCI_MAX_ENDPOINTS, and XWRITE4.
|
static |
Definition at line 4198 of file xhci.c.
References usb_device::bus, xhci_hw_dev::context_num, usb_device::controller_slot_id, xhci_hw_softc::devs, DPRINTF, xhci_hw_dev::ep_configured, index, xhci_hw_dev::input_pc, xhci_hw_dev::nports, usb_device::parent_hub, xhci_softc::sc_hw, xhci_hw_dev::state, xhci_hw_dev::tt, uhub_query_info(), usb_get_device_state(), USB_STATE_ADDRESSED, USB_STATE_CONFIGURED, USB_STATE_POWERED, usbd_get_page(), XHCI_BUS2SC, xhci_cmd_configure_ep(), xhci_cmd_evaluate_ctx(), XHCI_CMD_LOCK, xhci_cmd_reset_dev(), XHCI_CMD_UNLOCK, xhci_configure_device(), xhci_configure_mask(), XHCI_ST_ADDRESSED, XHCI_ST_CONFIGURED, and XHCI_ST_DEFAULT.
|
static |
Definition at line 4161 of file xhci.c.
References usb_device::bus, usb_device::controller_slot_id, DPRINTF, index, n, usb_device::parent_hub, XHCI_BUS2SC, XHCI_CMD_LOCK, xhci_cmd_stop_ep(), XHCI_CMD_UNLOCK, and XHCI_MAX_ENDPOINTS.
|
static |
Definition at line 4092 of file xhci.c.
References usb_device::bus, usb_device::controller_slot_id, xhci_hw_softc::devs, index, usb_device::parent_hub, xhci_softc::sc_hw, xhci_softc::sc_noslot, xhci_hw_dev::state, XHCI_BUS2SC, xhci_cmd_disable_slot(), XHCI_CMD_LOCK, XHCI_CMD_UNLOCK, xhci_free_device_ext(), and XHCI_ST_DISABLED.
|
static |
Definition at line 1119 of file xhci.c.
References addr, usb_page_search::buffer, usb_bus::bus_mtx, DPRINTF, xhci_trb::dwTrb2, xhci_trb::dwTrb3, xhci_hw_root::hwr_commands, xhci_trb::qwTrb0, retry, xhci_hw_softc::root_pc, xhci_softc::sc_bus, xhci_softc::sc_cmd_addr, xhci_softc::sc_cmd_cv, xhci_softc::sc_cmd_result, xhci_softc::sc_command_ccs, xhci_softc::sc_command_idx, xhci_softc::sc_hw, USB_BUS_LOCK, usb_bus_reset_async_locked(), USB_BUS_UNLOCK, USB_ERR_IOERROR, USB_ERR_TIMEOUT, USB_MS_TO_TICKS, usb_pc_cpu_flush(), usbd_get_page(), XHCI_CMD_ASSERT_LOCKED, XHCI_DOORBELL, xhci_interrupt_poll(), XHCI_MAX_COMMANDS, xhci_reset_command_queue_locked(), XHCI_TRB_2_ERROR_GET, XHCI_TRB_3_BSR_BIT, XHCI_TRB_3_CYCLE_BIT, XHCI_TRB_3_TC_BIT, XHCI_TRB_3_TYPE_GET, XHCI_TRB_3_TYPE_SET, XHCI_TRB_ERROR_SUCCESS, XHCI_TRB_TYPE_ADDRESS_DEVICE, XHCI_TRB_TYPE_LINK, and XWRITE4.
Referenced by xhci_cmd_configure_ep(), xhci_cmd_disable_slot(), xhci_cmd_enable_slot(), xhci_cmd_evaluate_ctx(), xhci_cmd_reset_dev(), xhci_cmd_reset_ep(), xhci_cmd_set_address(), xhci_cmd_set_tr_dequeue_ptr(), and xhci_cmd_stop_ep().
|
static |
Definition at line 1668 of file xhci.c.
References bus, xhci_softc::sc_bus, USB_BUS_LOCK, USB_BUS_UNLOCK, XHCI_BUS2SC, and xhci_interrupt_poll().
Referenced by xhci_start_controller().
|
static |
Definition at line 2792 of file xhci.c.
References usb_xfer_root::bus, usb_xfer_flags_int::control_xfr, usb_device::controller_slot_id, usb_xfer::endpointno, usb_device::flags, usb_xfer::flags_int, index, usb_device_flags::self_suspended, usb_xfer::stream_id, usb_xfer_root::udev, UE_DIR_IN, XHCI_BUS2SC, XHCI_DB_SID_SET, XHCI_DOORBELL, XHCI_EPNO2EPID, usb_xfer::xroot, and XWRITE4.
Referenced by xhci_activate_transfer(), xhci_skip_transfer(), and xhci_transfer_insert().
|
static |
Definition at line 4007 of file xhci.c.
References usb_device::bus, DPRINTF, usb_endpoint::edesc, usb_device::flags, usb_device::parent_hub, xhci_endpoint_ext::trb_halted, xhci_endpoint_ext::trb_running, USB_BUS_LOCK, USB_BUS_UNLOCK, usb_device_flags::usb_mode, USB_MODE_HOST, and xhci_get_endpoint_ext().
|
static |
Definition at line 3962 of file xhci.c.
References usb_device::address, usb_endpoint_descriptor::bEndpointAddress, usb_device::bus, usb_device::controller_slot_id, xhci_hw_softc::devs, xhci_hw_dev::ep_configured, usb_device::flags, index, usb_endpoint::methods, usb_device::parent_hub, xhci_softc::sc_hw, xhci_endpoint_ext::trb_halted, xhci_endpoint_ext::trb_running, UE_ADDR, USB_BUS_LOCK, USB_BUS_UNLOCK, usb_device_flags::usb_mode, XHCI_BUS2SC, xhci_device_generic_methods, XHCI_EPNO2EPID, and xhci_get_endpoint_ext().
|
static |
|
static |
Definition at line 2746 of file xhci.c.
References usb_device::bus, usb_device::controller_slot_id, xhci_hw_dev::device_pc, xhci_hw_softc::devs, xhci_hw_dev::endpoint_pc, index, xhci_hw_dev::input_pc, xhci_softc::sc_hw, usb_pc_free_mem(), XHCI_BUS2SC, XHCI_MAX_ENDPOINTS, and xhci_set_slot_pointer().
Referenced by xhci_alloc_device_ext(), and xhci_device_uninit().
|
static |
Definition at line 765 of file xhci.c.
References usb_xfer::aframes, usb_xfer_flags_int::control_act, usb_xfer_flags_int::control_hdr, usb_xfer_flags_int::control_xfr, usb_xfer::endpoint, usb_xfer::flags_int, usb_xfer::nframes, usb_xfer::td_transfer_cache, usb_xfer::td_transfer_first, xhci_device_done(), and xhci_generic_done_sub().
Referenced by xhci_check_transfer().
|
static |
Definition at line 684 of file xhci.c.
References usb_xfer::aframes, xhci_td::alt_next, usb_xfer_flags_int::control_xfr, DPRINTF, usb_xfer::flags_int, usb_xfer::frlengths, usb_xfer_flags_int::isochronous_xfr, len, xhci_td::len, usb_xfer::nframes, xhci_td::page_cache, xhci_td::remainder, usb_xfer_flags_int::short_frames_ok, status, xhci_td::status, usb_xfer::td_transfer_cache, usb_xfer::td_transfer_last, USB_ERR_IOERROR, USB_ERR_NORMAL_COMPLETION, USB_ERR_STALLED, usb_pc_cpu_invalidate(), usbd_xfer_set_frame_len(), XHCI_TRB_ERROR_LENGTH, XHCI_TRB_ERROR_SHORT_PKT, XHCI_TRB_ERROR_STALL, and XHCI_TRB_ERROR_SUCCESS.
Referenced by xhci_generic_done().
|
static |
|
static |
Definition at line 2762 of file xhci.c.
References usb_endpoint_descriptor::bEndpointAddress, usb_endpoint_descriptor::bmAttributes, usb_page_search::buffer, usb_device::bus, usb_device::controller_slot_id, xhci_hw_softc::devs, xhci_hw_dev::endp, xhci_hw_dev::endpoint_pc, index, xhci_endpoint_ext::page_cache, xhci_endpoint_ext::physaddr, xhci_softc::sc_hw, xhci_endpoint_ext::trb, UE_CONTROL, UE_DIR_IN, UE_XFERTYPE, usbd_get_page(), XHCI_BUS2SC, and XHCI_EPNO2EPID.
Referenced by xhci_configure_endpoint_by_xfer(), xhci_configure_msg(), xhci_configure_reset_endpoint(), xhci_ep_clear_stall(), xhci_ep_init(), xhci_set_address(), xhci_transfer_insert(), and xhci_transfer_remove().
|
static |
Definition at line 3739 of file xhci.c.
References usb_page_search::buffer, usb_device::bus, usb_device::controller_slot_id, ctx_ep, xhci_hw_dev::device_pc, xhci_hw_softc::devs, xhci_endp_ctx::dwEpCtx0, xhci_softc::sc_hw, usb_pc_cpu_invalidate(), usbd_get_page(), XHCI_BUS2SC, XHCI_EPCTX_0_EPSTATE_GET, and XHCI_GET_CTX.
Referenced by xhci_configure_reset_endpoint().
usb_error_t xhci_halt_controller | ( | struct xhci_softc * | sc | ) |
Definition at line 454 of file xhci.c.
References DPRINTF, usb_bus::parent, xhci_softc::sc_bus, xhci_softc::sc_capa_off, xhci_softc::sc_door_off, xhci_softc::sc_oper_off, xhci_softc::sc_runt_off, USB_ERR_IOERROR, usb_pause_mtx(), XHCI_CAPLENGTH, XHCI_DBOFF, XHCI_RTSOFF, XHCI_STS_HCH, XHCI_USBCMD, XHCI_USBSTS, XREAD1, XREAD4, and XWRITE4.
Referenced by xhci_pci_attach(), xhci_pci_detach(), and xhci_set_hw_power_sleep().
usb_error_t xhci_init | ( | struct xhci_softc * | sc, |
device_t | self, | ||
uint8_t | dma32 | ||
) |
Definition at line 511 of file xhci.c.
References usb_bus_msg::bus, usb_bus::control_ep_quirk, usb_bus::devices, usb_bus::devices_max, usb_bus::dma_bits, DPRINTF, usb_bus_msg::hdr, usb_bus::methods, usb_bus::parent, usb_proc_msg::pm_callback, xhci_softc::sc_bus, xhci_softc::sc_capa_off, xhci_softc::sc_cmd_cv, xhci_softc::sc_cmd_sx, xhci_softc::sc_command_ccs, xhci_softc::sc_config_msg, xhci_softc::sc_ctx_is_64_byte, xhci_softc::sc_devices, xhci_softc::sc_door_off, xhci_softc::sc_erst_max, xhci_softc::sc_event_ccs, xhci_softc::sc_exit_lat_max, xhci_softc::sc_imod_default, xhci_softc::sc_ist, xhci_softc::sc_noport, xhci_softc::sc_noscratch, xhci_softc::sc_noslot, xhci_softc::sc_oper_off, xhci_softc::sc_runt_off, usb_bus_mem_alloc_all(), USB_GET_DMA_TAG, USB_REV_3_0, usb_bus::usbrev, xhci_bus_methods, XHCI_CAPLENGTH, xhci_configure_msg, XHCI_DBOFF, XHCI_HCIVERSION, XHCI_HCS0_AC64, XHCI_HCS0_CSZ, XHCI_HCS1_DEVSLOT_MAX, XHCI_HCS1_N_PORTS, XHCI_HCS2_ERST_MAX, XHCI_HCS2_IST, XHCI_HCS2_SPB_MAX, XHCI_HCS3_U1_DEL, XHCI_HCS3_U2_DEL, XHCI_HCSPARAMS0, XHCI_HCSPARAMS1, XHCI_HCSPARAMS2, XHCI_HCSPARAMS3, XHCI_IMOD_DEFAULT, xhci_iterate_hw_softc(), XHCI_MAX_DEVICES, XHCI_MAX_RSEG, XHCI_MAX_SCRATCHPADS, XHCI_PAGESIZE, XHCI_PAGESIZE_4K, XHCI_RTSOFF, xhcictlquirk, xhcidma32, XREAD1, XREAD2, and XREAD4.
Referenced by generic_xhci_attach(), snps_dwc3_attach_xhci(), and xhci_pci_attach().
void xhci_interrupt | ( | struct xhci_softc * | sc | ) |
Definition at line 1603 of file xhci.c.
References xhci_softc::sc_bus, status, USB_BUS_LOCK, USB_BUS_UNLOCK, XHCI_IMAN, XHCI_IMAN_INTR_PEND, xhci_interrupt_poll(), xhci_root_intr(), XHCI_STS_HCE, XHCI_STS_HCH, XHCI_STS_HSE, XHCI_STS_PCD, XHCI_USBSTS, XREAD4, and XWRITE4.
Referenced by generic_xhci_attach(), snps_dwc3_attach_xhci(), xhci_interrupt_poll(), and xhci_pci_attach().
|
static |
Definition at line 1032 of file xhci.c.
References addr, usb_page_search::buffer, DPRINTF, xhci_trb::dwTrb2, xhci_trb::dwTrb3, xhci_hw_root::hwr_events, k, xhci_trb::qwTrb0, xhci_hw_softc::root_pc, xhci_softc::sc_event_ccs, xhci_softc::sc_event_idx, xhci_softc::sc_hw, usb_pc_cpu_invalidate(), usbd_get_page(), xhci_check_command(), xhci_check_transfer(), XHCI_ERDP_HI, XHCI_ERDP_LO, XHCI_ERDP_LO_BUSY, XHCI_MAX_EVENTS, XHCI_TRB_3_CYCLE_BIT, XHCI_TRB_3_TYPE_GET, XHCI_TRB_EVENT_CMD_COMPLETE, XHCI_TRB_EVENT_TRANSFER, and XWRITE4.
Referenced by xhci_do_command(), xhci_do_poll(), and xhci_interrupt().
|
static |
Definition at line 223 of file xhci.c.
References bus, xhci_hw_softc::ctx_pc, xhci_hw_softc::ctx_pg, xhci_hw_softc::root_pc, xhci_hw_softc::root_pg, xhci_softc::sc_hw, xhci_softc::sc_noscratch, xhci_hw_softc::scratch_pc, xhci_hw_softc::scratch_pg, XHCI_BUS2SC, and XHCI_PAGE_SIZE.
Referenced by xhci_init(), xhci_start_controller(), and xhci_uninit().
|
static |
Definition at line 241 of file xhci.c.
References addr, usb_page_search::buffer, usb_bus::bus_mtx, DPRINTF, xhci_hw_root::hwr_commands, xhci_trb::qwTrb0, xhci_hw_softc::root_pc, xhci_softc::sc_bus, xhci_softc::sc_command_ccs, xhci_softc::sc_command_idx, xhci_softc::sc_hw, USB_ERR_IOERROR, usb_pause_mtx(), usb_pc_cpu_flush(), usbd_get_page(), XHCI_CRCR_HI, XHCI_CRCR_LO, XHCI_CRCR_LO_CA, XHCI_CRCR_LO_CRR, XHCI_CRCR_LO_CS, XHCI_CRCR_LO_RCS, XHCI_MAX_COMMANDS, XREAD4, and XWRITE4.
Referenced by xhci_do_command().
usb_error_t xhci_reset_controller | ( | struct xhci_softc * | sc | ) |
Definition at line 484 of file xhci.c.
References DPRINTF, usb_bus::parent, xhci_softc::sc_bus, USB_ERR_IOERROR, usb_pause_mtx(), XHCI_CMD_HCRST, XHCI_STS_CNR, XHCI_USBCMD, XHCI_USBSTS, XREAD4, and XWRITE4.
Referenced by xhci_pci_detach(), xhci_set_hw_power_sleep(), and xhci_start_controller().
|
static |
Definition at line 2976 of file xhci.c.
References DPRINTF, xhci_softc::sc_bus, xhci_softc::sc_hub_idata, xhci_softc::sc_noport, uhub_root_intr(), USB_BUS_LOCK_ASSERT, XHCI_PORTSC, XHCI_PS_CEC, XHCI_PS_CSC, XHCI_PS_OCC, XHCI_PS_PEC, XHCI_PS_PLC, XHCI_PS_PRC, XHCI_PS_WRC, and XREAD4.
Referenced by xhci_interrupt().
|
static |
Definition at line 3214 of file xhci.c.
References usb_hub_ss_descriptor::bLength, usb_hub_ss_descriptor::bNbrPorts, usb_hub_ss_descriptor::bPwrOn2PwrGood, usb_device::bus, usb_bus::bus_mtx, C, xhci_hub_desc::hubd, index, len, pptr, xhci_hub_desc::ps, req, xhci_softc::sc_bus, xhci_softc::sc_conf, xhci_softc::sc_hub_desc, xhci_softc::sc_noport, xhci_softc::sc_vendor, xhci_hub_desc::stat, xhci_hub_desc::temp, UDESC_BOS, UDESC_CONFIG, UDESC_DEVICE, UDESC_STRING, UDS_SELF_POWERED, UGETW, UHD_OC_INDIVIDUAL, UHD_PORT_IND, UHD_PWR_GANGED, UHD_PWR_INDIVIDUAL, UHF_BH_PORT_RESET, UHF_C_BH_PORT_RESET, UHF_C_PORT_CONFIG_ERROR, UHF_C_PORT_CONNECTION, UHF_C_PORT_ENABLE, UHF_C_PORT_LINK_STATE, UHF_C_PORT_OVER_CURRENT, UHF_C_PORT_RESET, UHF_C_PORT_SUSPEND, UHF_PORT_ENABLE, UHF_PORT_INDICATOR, UHF_PORT_LINK_STATE, UHF_PORT_POWER, UHF_PORT_RESET, UHF_PORT_SUSPEND, UHF_PORT_TEST, UHF_PORT_U1_TIMEOUT, UHF_PORT_U2_TIMEOUT, UPS_C_BH_PORT_RESET, UPS_C_CONNECT_STATUS, UPS_C_OVERCURRENT_INDICATOR, UPS_C_PORT_CONFIG_ERROR, UPS_C_PORT_ENABLED, UPS_C_PORT_LINK_STATE, UPS_C_PORT_RESET, UPS_CURRENT_CONNECT_STATUS, UPS_HIGH_SPEED, UPS_LOW_SPEED, UPS_OTHER_SPEED, UPS_OVERCURRENT_INDICATOR, UPS_PORT_ENABLED, UPS_PORT_LINK_STATE_SET, UPS_RESET, UR_CLEAR_FEATURE, UR_CLEAR_TT_BUFFER, UR_GET_CONFIG, UR_GET_DESCRIPTOR, UR_GET_INTERFACE, UR_GET_STATUS, UR_GET_TT_STATE, UR_RESET_TT, UR_SET_ADDRESS, UR_SET_CONFIG, UR_SET_DESCRIPTOR, UR_SET_FEATURE, UR_SET_INTERFACE, UR_STOP_TT, UR_SYNCH_FRAME, USB_BUS_LOCK_ASSERT, USB_ERR_IOERROR, usb_make_str_desc(), usb_pause_mtx(), USETW, UT_READ_CLASS_DEVICE, UT_READ_CLASS_OTHER, UT_READ_DEVICE, UT_READ_ENDPOINT, UT_READ_INTERFACE, UT_WRITE_CLASS_DEVICE, UT_WRITE_CLASS_OTHER, UT_WRITE_DEVICE, UT_WRITE_ENDPOINT, UT_WRITE_INTERFACE, value, usb_hub_ss_descriptor::wHubCharacteristics, usb_port_status::wPortChange, usb_port_status::wPortStatus, usb_status::wStatus, xhci_bosd, XHCI_BUS2SC, xhci_confd, xhci_devd, XHCI_HCS0_PIND, XHCI_HCS0_PPC, XHCI_HCSPARAMS0, xhci_hubd, XHCI_MAX_DEVICES, XHCI_PM3_U1TO_SET, XHCI_PM3_U2TO_SET, XHCI_PORTPMSC, XHCI_PORTSC, XHCI_PS_CCS, XHCI_PS_CEC, XHCI_PS_CSC, XHCI_PS_DR, XHCI_PS_LWS, XHCI_PS_OCA, XHCI_PS_OCC, XHCI_PS_PEC, XHCI_PS_PED, XHCI_PS_PIC_SET, XHCI_PS_PLC, XHCI_PS_PLS_GET, XHCI_PS_PLS_SET, XHCI_PS_PP, XHCI_PS_PR, XHCI_PS_PRC, XHCI_PS_SPEED_GET, XHCI_PS_WPR, XHCI_PS_WRC, XREAD4, and XWRITE4.
|
static |
Definition at line 1343 of file xhci.c.
References usb_device::address, address, usb_page_search::buffer, usb_device::bus, usb_device::controller_slot_id, usb_device::ctrl_ep_desc, ctx_slot, xhci_hw_dev::device_pc, xhci_hw_softc::devs, DPRINTF, index, xhci_hw_dev::input_pc, usb_bus::parent, usb_device::parent_hub, xhci_softc::sc_bus, xhci_softc::sc_cmd_result, xhci_softc::sc_hw, xhci_softc::sc_port_route, slot, usb_device::speed, xhci_hw_dev::state, xhci_endpoint_ext::trb_halted, xhci_endpoint_ext::trb_running, USB_BUS_LOCK, USB_BUS_UNLOCK, USB_EP_MODE_DEFAULT, USB_ERR_INVAL, USB_ERR_IOERROR, usb_pc_cpu_invalidate(), USB_SPEED_FULL, USB_SPEED_HIGH, USB_SPEED_LOW, usbd_get_page(), XHCI_BUS2SC, XHCI_CMD_LOCK, xhci_cmd_set_address(), XHCI_CMD_UNLOCK, xhci_configure_device(), xhci_configure_endpoint(), xhci_configure_mask(), XHCI_GET_CTX, xhci_get_endpoint_ext(), XHCI_SCTX_3_DEV_ADDR_GET, XHCI_ST_ADDRESSED, XHCI_ST_DEFAULT, XHCI_ST_ENABLED, XHCI_TRB_2_ERROR_GET, and XHCI_TRB_ERROR_PARAMETER.
Referenced by xhci_device_init().
|
static |
Definition at line 4303 of file xhci.c.
References usb_endpoint_descriptor::bmAttributes, usb_endpoint::edesc, usb_device::speed, UE_BULK, UE_XFERTYPE, USB_EP_MODE_DEFAULT, USB_EP_MODE_STREAMS, USB_ERR_INVAL, USB_SPEED_SUPER, and xhcistreams.
|
static |
|
static |
Definition at line 659 of file xhci.c.
References bus, DPRINTF, state, USB_HW_POWER_RESUME, USB_HW_POWER_SHUTDOWN, USB_HW_POWER_SUSPEND, XHCI_BUS2SC, xhci_halt_controller(), xhci_reset_controller(), and xhci_start_controller().
|
static |
Definition at line 2233 of file xhci.c.
References usb_page_search::buffer, xhci_hw_softc::ctx_pc, DPRINTF, index, xhci_dev_ctx_addr::qwBaaDevCtxAddr, xhci_softc::sc_hw, usb_pc_cpu_flush(), and usbd_get_page().
Referenced by xhci_alloc_device_ext(), and xhci_free_device_ext().
|
static |
Definition at line 1980 of file xhci.c.
References xhci_std_temp::average, usb_endpoint_ss_comp_descriptor::bmAttributes, usb_xfer_root::bus, usb_xfer_flags_int::control_act, usb_xfer_flags_int::control_did_data, usb_xfer_flags_int::control_hdr, usb_xfer_flags_int::control_xfr, usb_xfer_flags_int::curr_dma_set, xhci_std_temp::direction, xhci_std_temp::do_isoc_sync, DPRINTF, usb_endpoint::ecomp, usb_endpoint::edesc, usb_xfer::endpoint, usb_xfer::endpointno, usb_xfer::flags, usb_xfer::flags_int, usb_xfer_flags::force_short_xfer, usb_xfer::frbuffers, usb_xfer::frlengths, xhci_std_temp::isoc_delta, xhci_std_temp::isoc_frame, usb_xfer_flags_int::isochronous_xfr, xhci_std_temp::last_frame, xhci_std_temp::len, usb_xfer::max_frame_size, usb_xfer::max_hc_frame_size, xhci_std_temp::max_packet_size, usb_xfer::max_packet_size, xhci_std_temp::multishort, usb_xfer::nframes, xhci_std_temp::offset, xhci_std_temp::pc, xhci_std_temp::sc, xhci_softc::sc_ctlstep, xhci_softc::sc_ist, usb_xfer_flags_int::short_frames_ok, xhci_std_temp::shortpkt, xhci_std_temp::step_td, xhci_std_temp::tbc, xhci_std_temp::td, xhci_std_temp::td_next, usb_xfer::td_start, usb_xfer::td_transfer_cache, usb_xfer::td_transfer_first, usb_xfer::td_transfer_last, xhci_std_temp::tlbpc, xhci_std_temp::trb_type, usb_xfer_root::udev, UE_DIR_IN, UE_GET_DIR, UE_GET_SS_ISO_MULT, USB_SPEED_FULL, usbd_get_speed(), usbd_xfer_get_fps_shift(), usbd_xfer_get_isochronous_start_frame(), XHCI_BUS2SC, XHCI_MFINDEX, XHCI_MFINDEX_GET, xhci_setup_generic_chain_sub(), XHCI_TRB_TYPE_DATA_STAGE, XHCI_TRB_TYPE_ISOCH, XHCI_TRB_TYPE_NORMAL, XHCI_TRB_TYPE_SETUP_STAGE, XHCI_TRB_TYPE_STATUS_STAGE, xhcictlstep, XREAD4, and usb_xfer::xroot.
Referenced by xhci_device_generic_enter().
|
static |
Definition at line 1678 of file xhci.c.
References xhci_td::alt_next, xhci_std_temp::average, xhci_std_temp::direction, xhci_std_temp::do_isoc_sync, DPRINTF, xhci_trb::dwTrb2, xhci_trb::dwTrb3, xhci_std_temp::isoc_frame, xhci_std_temp::last_frame, xhci_std_temp::len, xhci_td::len, usb_page_search::length, xhci_std_temp::max_packet_size, xhci_td::ntrb, xhci_td::obj_next, xhci_std_temp::offset, xhci_td::page_cache, xhci_std_temp::pc, xhci_trb::qwTrb0, xhci_td::remainder, xhci_std_temp::shortpkt, xhci_td::status, xhci_std_temp::step_td, xhci_std_temp::tbc, xhci_std_temp::td, td_next, xhci_std_temp::td_next, xhci_td::td_trb, xhci_std_temp::tlbpc, xhci_std_temp::trb_type, UE_DIR_IN, usb_pc_cpu_flush(), usbd_copy_out(), usbd_get_page(), XHCI_TD_PAGE_SIZE, XHCI_TRB_0_DIR_IN_MASK, XHCI_TRB_0_WLENGTH_MASK, XHCI_TRB_2_BYTES_SET, XHCI_TRB_2_IRQ_SET, XHCI_TRB_2_TDSZ_SET, XHCI_TRB_3_CHAIN_BIT, XHCI_TRB_3_CYCLE_BIT, XHCI_TRB_3_DIR_IN, XHCI_TRB_3_FRID_SET, XHCI_TRB_3_IDT_BIT, XHCI_TRB_3_IOC_BIT, XHCI_TRB_3_ISO_SIA_BIT, XHCI_TRB_3_ISP_BIT, XHCI_TRB_3_TBC_SET, XHCI_TRB_3_TLBPC_SET, XHCI_TRB_3_TRT_IN, XHCI_TRB_3_TRT_OUT, XHCI_TRB_3_TYPE_SET, XHCI_TRB_TYPE_DATA_STAGE, XHCI_TRB_TYPE_ISOCH, XHCI_TRB_TYPE_LINK, XHCI_TRB_TYPE_NORMAL, XHCI_TRB_TYPE_SETUP_STAGE, and XHCI_TRB_TYPE_STATUS_STAGE.
Referenced by xhci_setup_generic_chain().
|
static |
Definition at line 822 of file xhci.c.
References xhci_td::alt_next, xhci_trb::dwTrb2, xhci_trb::dwTrb3, xhci_td::ntrb, xhci_td::page_cache, xhci_trb::qwTrb0, usb_xfer::td_transfer_cache, usb_xfer::td_transfer_last, xhci_td::td_trb, usb_pc_cpu_flush(), usb_pc_cpu_invalidate(), xhci_endpoint_doorbell(), and XHCI_TRB_3_CYCLE_BIT.
Referenced by xhci_check_transfer().
usb_error_t xhci_start_controller | ( | struct xhci_softc * | sc | ) |
Definition at line 304 of file xhci.c.
References addr, usb_page_search::buffer, xhci_hw_softc::ctx_pc, DPRINTF, xhci_event_ring_seg::dwEvrsTableSize, xhci_hw_root::hwr_commands, xhci_hw_root::hwr_ring_seg, usb_bus::parent, xhci_dev_ctx_addr::qwBaaDevCtxAddr, xhci_event_ring_seg::qwEvrsTablePtr, xhci_dev_ctx_addr::qwSpBufPtr, xhci_trb::qwTrb0, xhci_hw_softc::root_pc, xhci_softc::sc_bus, xhci_softc::sc_command_ccs, xhci_softc::sc_command_idx, xhci_softc::sc_erst_max, xhci_softc::sc_event_ccs, xhci_softc::sc_event_idx, xhci_softc::sc_hw, xhci_softc::sc_imod_default, xhci_softc::sc_noscratch, xhci_softc::sc_noslot, xhci_softc::sc_port_route, xhci_hw_softc::scratch_pc, usb_bus_mem_flush_all(), USB_ERR_IOERROR, usb_pause_mtx(), usbd_get_page(), XHCI_CMD_HSEE, XHCI_CMD_INTE, XHCI_CMD_RS, XHCI_CONFIG, XHCI_CRCR_HI, XHCI_CRCR_LO, XHCI_CRCR_LO_RCS, XHCI_DCBAAP_HI, XHCI_DCBAAP_LO, XHCI_DNCTRL, xhci_do_poll(), XHCI_ERDP_HI, XHCI_ERDP_LO, XHCI_ERSTBA_HI, XHCI_ERSTBA_LO, XHCI_ERSTS_SET, XHCI_ERSTSZ, XHCI_IMAN, XHCI_IMAN_INTR_ENA, XHCI_IMOD, xhci_iterate_hw_softc(), XHCI_MAX_COMMANDS, XHCI_MAX_EVENTS, xhci_reset_controller(), XHCI_STS_HCH, XHCI_USBCMD, XHCI_USBSTS, xhciroute, XREAD4, and XWRITE4.
Referenced by generic_xhci_attach(), snps_dwc3_attach_xhci(), xhci_pci_attach(), and xhci_set_hw_power_sleep().
|
static |
Definition at line 3870 of file xhci.c.
References usb_xfer_root::bus, usb_bus::intr_q, xhci_softc::sc_bus, xhci_softc::sc_config_msg, usb_proc_msignal(), usbd_transfer_enqueue(), XHCI_BUS2SC, and usb_xfer::xroot.
|
static |
Definition at line 1655 of file xhci.c.
References usb_xfer_root::bus, DPRINTF, USB_BUS_LOCK_ASSERT, USB_ERR_TIMEOUT, xhci_device_done(), and usb_xfer::xroot.
Referenced by xhci_device_generic_start().
|
static |
Definition at line 2834 of file xhci.c.
References addr, usb_xfer_flags_int::bandwidth_reclaimed, usb_endpoint_descriptor::bmAttributes, usb_xfer_root::bus, usb_xfer_flags_int::control_xfr, DPRINTF, xhci_trb::dwTrb2, xhci_trb::dwTrb3, usb_endpoint::edesc, usb_xfer::endpoint, usb_xfer::flags_int, id, xhci_td::ntrb, xhci_td::page_cache, xhci_endpoint_ext::page_cache, xhci_endpoint_ext::physaddr, usb_xfer::qh_pos, xhci_trb::qwTrb0, xhci_softc::sc_bus, xhci_softc::sc_config_msg, usb_xfer::stream_id, xhci_td::td_self, usb_xfer::td_transfer_first, usb_xfer::td_transfer_last, xhci_td::td_trb, xhci_endpoint_ext::trb, xhci_endpoint_ext::trb_ep_maxp, xhci_endpoint_ext::trb_halted, xhci_endpoint_ext::trb_index, xhci_endpoint_ext::trb_running, xhci_endpoint_ext::trb_used, usb_xfer_root::udev, UE_CONTROL, UE_INTERRUPT, UE_XFERTYPE, USB_ERR_NOMEM, usb_pc_cpu_flush(), usb_proc_msignal(), usb_endpoint_descriptor::wMaxPacketSize, xhci_endpoint_ext::xfer, XHCI_BUS2SC, xhci_endpoint_doorbell(), xhci_get_endpoint_ext(), XHCI_MAX_TRANSFERS, XHCI_TRB_2_IRQ_SET, XHCI_TRB_3_CYCLE_BIT, XHCI_TRB_3_IOC_BIT, XHCI_TRB_3_TYPE_SET, XHCI_TRB_TYPE_LINK, and usb_xfer::xroot.
Referenced by xhci_configure_msg(), xhci_device_generic_multi_enter(), and xhci_device_generic_start().
|
static |
Definition at line 2812 of file xhci.c.
References usb_xfer_flags_int::bandwidth_reclaimed, usb_endpoint::edesc, usb_xfer::endpoint, error, usb_xfer::flags_int, usb_xfer::qh_pos, usb_xfer::stream_id, xhci_endpoint_ext::trb_halted, xhci_endpoint_ext::trb_running, xhci_endpoint_ext::trb_used, usb_xfer_root::udev, xhci_endpoint_ext::xfer, xhci_get_endpoint_ext(), and usb_xfer::xroot.
Referenced by xhci_device_done().
void xhci_uninit | ( | struct xhci_softc * | sc | ) |
Definition at line 644 of file xhci.c.
References xhci_softc::sc_bus, xhci_softc::sc_cmd_cv, xhci_softc::sc_cmd_sx, usb_bus_mem_free_all(), and xhci_iterate_hw_softc().
Referenced by generic_xhci_detach(), and xhci_pci_detach().
uint8_t xhci_use_polling | ( | void | ) |
Definition at line 213 of file xhci.c.
Referenced by xhci_pci_attach().
|
static |
Definition at line 3638 of file xhci.c.
References usb_setup_params::buf, usb_page_search::buffer, usb_xfer_flags_int::control_xfr, usb_xfer_flags_int::curr_dma_set, usb_setup_params::curr_xfer, usb_setup_params::err, usb_xfer::flags_int, usb_setup_params::hc_max_frame_size, usb_setup_params::hc_max_packet_count, usb_setup_params::hc_max_packet_size, usb_xfer_flags_int::isochronous_xfr, usb_xfer::max_data_length, usb_xfer::max_hc_frame_size, n, usb_xfer::nframes, xhci_td::obj_next, xhci_td::page_cache, xhci_td::td_self, usb_xfer::td_start, USB_ERR_NOMEM, usb_pc_cpu_flush(), usbd_get_page(), usbd_transfer_setup_sub(), usbd_transfer_setup_sub_malloc(), XHCI_TD_ALIGN, and XHCI_TD_PAYLOAD_MAX.
|
static |
|
static |
Definition at line 3139 of file xhci.c.
Referenced by xhci_roothub_exec().
|
static |
Definition at line 176 of file xhci.c.
Referenced by xhci_init().
|
static |
Definition at line 3172 of file xhci.c.
Referenced by xhci_roothub_exec().
|
static |
Definition at line 164 of file xhci.c.
Referenced by xhci_init().
|
static |
Definition at line 3120 of file xhci.c.
Referenced by xhci_roothub_exec().
|
static |
Definition at line 3104 of file xhci.c.
Referenced by xhci_ep_init().
|
static |
Definition at line 3208 of file xhci.c.
Referenced by xhci_roothub_exec().
|
static |
Definition at line 103 of file xhci.c.
Referenced by xhci_init().
|
static |
Definition at line 107 of file xhci.c.
Referenced by xhci_cmd_configure_ep().
|
static |
Definition at line 99 of file xhci.c.
Referenced by xhci_set_endpoint_mode().