/illumos-gate/usr/src/uts/common/io/usb/hcd/xhci/ |
H A D | xhci.c | 786 xhci_error(xhci_t *xhcip, const char *fmt, ...) in xhci_error() argument 791 if (xhcip != NULL && xhcip->xhci_dip != NULL) { in xhci_error() 792 vdev_err(xhcip->xhci_dip, CE_WARN, fmt, ap); in xhci_error() 800 xhci_log(xhci_t *xhcip, const char *fmt, ...) in xhci_log() argument 805 if (xhcip != NULL && xhcip->xhci_dip != NULL) { in xhci_log() 806 vdev_err(xhcip->xhci_dip, CE_NOTE, fmt, ap); in xhci_log() 822 xhci_t *xhcip; in xhci_get_dip() local 825 xhcip = ddi_get_soft_state(xhci_soft_state, instance); in xhci_get_dip() 826 if (xhcip != NULL) in xhci_get_dip() 827 return (xhcip->xhci_dip); in xhci_get_dip() [all …]
|
H A D | xhci_intr.c | 49 xhci_ddi_intr_disable(xhci_t *xhcip) in xhci_ddi_intr_disable() argument 53 if (xhcip->xhci_intr_caps & DDI_INTR_FLAG_BLOCK) { in xhci_ddi_intr_disable() 54 if ((ret = ddi_intr_block_disable(&xhcip->xhci_intr_hdl, in xhci_ddi_intr_disable() 55 xhcip->xhci_intr_num)) != DDI_SUCCESS) { in xhci_ddi_intr_disable() 56 xhci_error(xhcip, "failed to block-disable interrupts: " in xhci_ddi_intr_disable() 61 if ((ret = ddi_intr_disable(xhcip->xhci_intr_hdl)) != in xhci_ddi_intr_disable() 63 xhci_error(xhcip, "failed to disable interrupt: %d", in xhci_ddi_intr_disable() 74 xhci_ddi_intr_enable(xhci_t *xhcip) in xhci_ddi_intr_enable() argument 78 if (xhcip->xhci_intr_caps & DDI_INTR_FLAG_BLOCK) { in xhci_ddi_intr_enable() 79 if ((ret = ddi_intr_block_enable(&xhcip->xhci_intr_hdl, in xhci_ddi_intr_enable() [all …]
|
H A D | xhci_context.c | 28 xhci_scratchpad_fini(xhci_t *xhcip) in xhci_scratchpad_fini() argument 30 xhci_scratchpad_t *xsp = &xhcip->xhci_scratchpad; in xhci_scratchpad_fini() 34 npages = xhcip->xhci_caps.xcap_max_scratch; in xhci_scratchpad_fini() 47 xhci_context_fini(xhci_t *xhcip) in xhci_context_fini() argument 49 xhci_scratchpad_fini(xhcip); in xhci_context_fini() 50 xhci_dma_free(&xhcip->xhci_dcbaa.xdc_dma); in xhci_context_fini() 51 xhcip->xhci_dcbaa.xdc_base_addrs = NULL; in xhci_context_fini() 55 xhci_scratchpad_alloc(xhci_t *xhcip) in xhci_scratchpad_alloc() argument 65 ASSERT(xhcip->xhci_caps.xcap_max_scratch > 0); in xhci_scratchpad_alloc() 66 npages = xhcip->xhci_caps.xcap_max_scratch; in xhci_scratchpad_alloc() [all …]
|
H A D | xhci_usba.c | 33 xhci_t *xhcip = ddi_get_soft_state(xhci_soft_state, in xhci_hcdi_get_xhcip_from_dev() local 35 VERIFY(xhcip != NULL); in xhci_hcdi_get_xhcip_from_dev() 36 return (xhcip); in xhci_hcdi_get_xhcip_from_dev() 60 xhci_t *xhcip = xhci_hcdi_get_xhcip(ph); in xhci_hcdi_pipe_open() local 68 mutex_enter(&xhcip->xhci_lock); in xhci_hcdi_pipe_open() 69 if (xhcip->xhci_state & XHCI_S_ERROR) { in xhci_hcdi_pipe_open() 70 mutex_exit(&xhcip->xhci_lock); in xhci_hcdi_pipe_open() 73 mutex_exit(&xhcip->xhci_lock); in xhci_hcdi_pipe_open() 108 xhci_error(xhcip, "!encountered endpoint (%d) without device " in xhci_hcdi_pipe_open() 120 mutex_enter(&xhcip->xhci_lock); in xhci_hcdi_pipe_open() [all …]
|
H A D | xhci_hub.c | 152 xhci_root_hub_get_device_status(xhci_t *xhcip, usb_ctrl_req_t *ucrp) in xhci_root_hub_get_device_status() argument 159 ASSERT(MUTEX_HELD(&xhcip->xhci_lock)); in xhci_root_hub_get_device_status() 203 xhci_root_hub_get_status(xhci_t *xhcip, usb_ctrl_req_t *ucrp) in xhci_root_hub_get_status() argument 208 ASSERT(MUTEX_HELD(&xhcip->xhci_lock)); in xhci_root_hub_get_status() 227 xhci_root_hub_get_descriptor(xhci_t *xhcip, usb_ctrl_req_t *ucrp) in xhci_root_hub_get_descriptor() argument 231 ASSERT(MUTEX_HELD(&xhcip->xhci_lock)); in xhci_root_hub_get_descriptor() 239 bcopy(&xhcip->xhci_usba.xa_hub_descr, ucrp->ctrl_data->b_wptr, len); in xhci_root_hub_get_descriptor() 244 xhci_root_hub_handle_port_clear_feature(xhci_t *xhcip, usb_ctrl_req_t *ucrp) in xhci_root_hub_handle_port_clear_feature() argument 250 ASSERT(MUTEX_HELD(&xhcip->xhci_lock)); in xhci_root_hub_handle_port_clear_feature() 252 if (port < 1 || port > xhcip->xhci_caps.xcap_max_ports) in xhci_root_hub_handle_port_clear_feature() [all …]
|
H A D | xhci_event.c | 38 xhci_event_fini(xhci_t *xhcip) in xhci_event_fini() argument 40 xhci_event_ring_t *xev = &xhcip->xhci_event; in xhci_event_fini() 52 xhci_event_alloc(xhci_t *xhcip, xhci_event_ring_t *xev) in xhci_event_alloc() argument 63 xhci_dma_acc_attr(xhcip, &acc); in xhci_event_alloc() 64 xhci_dma_dma_attr(xhcip, &attr); in xhci_event_alloc() 65 if (!xhci_dma_alloc(xhcip, &xev->xev_dma, &attr, &acc, B_FALSE, in xhci_event_alloc() 68 if ((ret = xhci_ring_alloc(xhcip, &xev->xev_ring)) != 0) { in xhci_event_alloc() 78 xhci_event_init(xhci_t *xhcip) in xhci_event_init() argument 82 xhci_event_ring_t *xev = &xhcip->xhci_event; in xhci_event_init() 85 if ((ret = xhci_event_alloc(xhcip, xev)) != 0) in xhci_event_init() [all …]
|
H A D | xhci_command.c | 139 xhci_command_ring_fini(xhci_t *xhcip) in xhci_command_ring_fini() argument 141 xhci_command_ring_t *xcr = &xhcip->xhci_command; in xhci_command_ring_fini() 161 xhci_command_ring_init(xhci_t *xhcip) in xhci_command_ring_init() argument 165 xhci_command_ring_t *xcr = &xhcip->xhci_command; in xhci_command_ring_init() 168 if ((ret = xhci_ring_alloc(xhcip, &xcr->xcr_ring)) != 0) in xhci_command_ring_init() 172 if ((ret = xhci_ring_reset(xhcip, &xcr->xcr_ring)) != 0) in xhci_command_ring_init() 176 addr = xhci_get64(xhcip, XHCI_R_OPER, XHCI_CRCR); in xhci_command_ring_init() 180 xhci_put64(xhcip, XHCI_R_OPER, XHCI_CRCR, addr); in xhci_command_ring_init() 181 if (xhci_check_regs_acc(xhcip) != DDI_FM_OK) in xhci_command_ring_init() 185 DDI_INTR_PRI(xhcip->xhci_intr_pri)); in xhci_command_ring_init() [all …]
|
H A D | xhci_endpoint.c | 42 xhci_input_context_sync(xhci_t *xhcip, xhci_device_t *xd, xhci_endpoint_t *xep) in xhci_input_context_sync() argument 45 if (xhci_check_dma_handle(xhcip, &xd->xd_ictx) != DDI_FM_OK) { in xhci_input_context_sync() 46 xhci_error(xhcip, "failed to initialize device input " in xhci_input_context_sync() 50 xhci_fm_runtime_reset(xhcip); in xhci_input_context_sync() 84 xhci_endpoint_timeout_cancel(xhci_t *xhcip, xhci_endpoint_t *xep) in xhci_endpoint_timeout_cancel() argument 88 mutex_exit(&xhcip->xhci_lock); in xhci_endpoint_timeout_cancel() 90 mutex_enter(&xhcip->xhci_lock); in xhci_endpoint_timeout_cancel() 108 xhci_endpoint_close(xhci_t *xhcip, xhci_endpoint_t *xep) in xhci_endpoint_close() argument 110 VERIFY(MUTEX_HELD(&xhcip->xhci_lock)); in xhci_endpoint_close() 120 xhci_endpoint_timeout_cancel(xhcip, xep); in xhci_endpoint_close() [all …]
|
H A D | xhci_polled.c | 62 xhci_polled_init(usba_pipe_handle_data_t *input_pipe_handle, xhci_t *xhcip, in xhci_polled_init() argument 69 ASSERT(mutex_owned(&xhcip->xhci_lock)); in xhci_polled_init() 93 xhci_polledp->xhci_polled_xhci = xhcip; in xhci_polled_init() 102 xhci_polled_get_endpoint(xhci_t *xhcip, xhci_trb_t *trb) in xhci_polled_get_endpoint() argument 110 xd = xhci_device_lookup_by_slot(xhcip, slot); in xhci_polled_get_endpoint() 125 xhci_t *xhcip = xhci_polledp->xhci_polled_xhci; in xhci_polled_endpoint_transfer() local 139 if ((xt = xhci_endpoint_determine_transfer(xhcip, xep, trb, &off)) == in xhci_polled_endpoint_transfer() 156 if (xhci_transfer_sync(xhcip, xt, DDI_DMA_SYNC_FORCPU) != DDI_FM_OK) { in xhci_polled_endpoint_transfer() 160 "DMA memory", xhcip, xep->xep_num, xd->xd_slot, in xhci_polled_endpoint_transfer() 185 sched_err = xhci_endpoint_schedule(xhcip, xd, xep, xt, B_TRUE); in xhci_polled_endpoint_transfer() [all …]
|
H A D | xhci_quirks.c | 45 xhci_quirks_populate(xhci_t *xhcip) in xhci_quirks_populate() argument 50 if (xqt->xqt_vendor == xhcip->xhci_vendor_id && in xhci_quirks_populate() 51 xqt->xqt_device == xhcip->xhci_device_id) { in xhci_quirks_populate() 52 xhcip->xhci_quirks = xqt->xqt_quirks; in xhci_quirks_populate() 65 xhci_reroute_intel(xhci_t *xhcip) in xhci_reroute_intel() argument 69 ports = pci_config_get32(xhcip->xhci_cfg_handle, in xhci_reroute_intel() 71 pci_config_put32(xhcip->xhci_cfg_handle, PCI_XHCI_INTEL_USB3_PSSEN, in xhci_reroute_intel() 74 ports = pci_config_get32(xhcip->xhci_cfg_handle, in xhci_reroute_intel() 76 pci_config_put32(xhcip->xhci_cfg_handle, PCI_XHCI_INTEL_XUSB2PR, in xhci_reroute_intel()
|
H A D | xhci_dma.c | 25 xhci_check_dma_handle(xhci_t *xhcip, xhci_dma_buffer_t *xdb) in xhci_check_dma_handle() argument 29 if (!DDI_FM_DMA_ERR_CAP(xhcip->xhci_fm_caps)) in xhci_check_dma_handle() 37 xhci_dma_acc_attr(xhci_t *xhcip, ddi_device_acc_attr_t *accp) in xhci_dma_acc_attr() argument 43 if (DDI_FM_DMA_ERR_CAP(xhcip->xhci_fm_caps)) { in xhci_dma_acc_attr() 56 xhci_dma_transfer_attr(xhci_t *xhcip, ddi_dma_attr_t *attrp, uint_t sgl) in xhci_dma_transfer_attr() argument 66 if (xhcip->xhci_caps.xcap_flags & XCAP_AC64) { in xhci_dma_transfer_attr() 113 if (DDI_FM_DMA_ERR_CAP(xhcip->xhci_fm_caps)) { in xhci_dma_transfer_attr() 126 xhci_dma_dma_attr(xhci_t *xhcip, ddi_dma_attr_t *attrp) in xhci_dma_dma_attr() argument 132 xhci_dma_transfer_attr(xhcip, attrp, XHCI_DEF_DMA_SGL); in xhci_dma_dma_attr() 139 attrp->dma_attr_count_max = xhcip->xhci_caps.xcap_pagesize; in xhci_dma_dma_attr() [all …]
|
H A D | xhci_ring.c | 132 xhci_ring_reset(xhci_t *xhcip, xhci_ring_t *xrp) in xhci_ring_reset() argument 151 if (xhci_check_dma_handle(xhcip, &xrp->xr_dma) != DDI_FM_OK) { in xhci_ring_reset() 152 ddi_fm_service_impact(xhcip->xhci_dip, DDI_SERVICE_LOST); in xhci_ring_reset() 160 xhci_ring_alloc(xhci_t *xhcip, xhci_ring_t *xrp) in xhci_ring_alloc() argument 169 xhci_dma_acc_attr(xhcip, &acc); in xhci_ring_alloc() 170 xhci_dma_transfer_attr(xhcip, &attr, XHCI_DEF_DMA_SGL); in xhci_ring_alloc() 172 if (xhci_dma_alloc(xhcip, &xrp->xr_dma, &attr, &acc, B_FALSE, in xhci_ring_alloc() 173 xhcip->xhci_caps.xcap_pagesize, B_FALSE) == B_FALSE) in xhci_ring_alloc() 176 xrp->xr_ntrb = xhcip->xhci_caps.xcap_pagesize / sizeof (xhci_trb_t); in xhci_ring_alloc()
|
/illumos-gate/usr/src/uts/common/sys/usb/hcd/xhci/ |
H A D | xhci.h | 924 extern void xhci_log(xhci_t *xhcip, const char *fmt, ...) __KPRINTFLIKE(2); 925 extern void xhci_error(xhci_t *xhcip, const char *fmt, ...) __KPRINTFLIKE(2);
|