Lines Matching refs:hcd
281 struct usb_hcd *hcd = xhci_to_hcd(xhci); in xhci_setup_msix() local
282 struct pci_dev *pdev = to_pci_dev(hcd->self.controller); in xhci_setup_msix()
322 hcd->msix_enabled = 1; in xhci_setup_msix()
338 struct usb_hcd *hcd = xhci_to_hcd(xhci); in xhci_cleanup_msix() local
339 struct pci_dev *pdev = to_pci_dev(hcd->self.controller); in xhci_cleanup_msix()
354 hcd->msix_enabled = 0; in xhci_cleanup_msix()
368 static int xhci_try_enable_msi(struct usb_hcd *hcd) in xhci_try_enable_msi() argument
370 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_try_enable_msi()
387 if (hcd->irq) in xhci_try_enable_msi()
388 free_irq(hcd->irq, hcd); in xhci_try_enable_msi()
389 hcd->irq = 0; in xhci_try_enable_msi()
406 if (!strlen(hcd->irq_descr)) in xhci_try_enable_msi()
407 snprintf(hcd->irq_descr, sizeof(hcd->irq_descr), "%s:usb%d", in xhci_try_enable_msi()
408 hcd->driver->description, hcd->self.busnum); in xhci_try_enable_msi()
412 hcd->irq_descr, hcd); in xhci_try_enable_msi()
418 hcd->irq = pdev->irq; in xhci_try_enable_msi()
424 static inline int xhci_try_enable_msi(struct usb_hcd *hcd) in xhci_try_enable_msi() argument
442 struct usb_hcd *hcd; in compliance_mode_recovery() local
460 hcd = xhci->shared_hcd; in compliance_mode_recovery()
462 if (hcd->state == HC_STATE_SUSPENDED) in compliance_mode_recovery()
463 usb_hcd_resume_root_hub(hcd); in compliance_mode_recovery()
465 usb_hcd_poll_rh_status(hcd); in compliance_mode_recovery()
539 int xhci_init(struct usb_hcd *hcd) in xhci_init() argument
541 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_init()
598 int xhci_run(struct usb_hcd *hcd) in xhci_run() argument
603 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_run()
609 hcd->uses_new_polling = 1; in xhci_run()
610 if (!usb_hcd_is_primary_hcd(hcd)) in xhci_run()
615 ret = xhci_try_enable_msi(hcd); in xhci_run()
678 void xhci_stop(struct usb_hcd *hcd) in xhci_stop() argument
681 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_stop()
737 void xhci_shutdown(struct usb_hcd *hcd) in xhci_shutdown() argument
739 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_shutdown()
742 usb_disable_xhci_ports(to_pci_dev(hcd->self.controller)); in xhci_shutdown()
759 pci_set_power_state(to_pci_dev(hcd->self.controller), PCI_D3hot); in xhci_shutdown()
897 struct usb_hcd *hcd = xhci_to_hcd(xhci); in xhci_suspend() local
900 if (!hcd->state) in xhci_suspend()
903 if (hcd->state != HC_STATE_SUSPENDED || in xhci_suspend()
913 clear_bit(HCD_FLAG_POLL_RH, &hcd->flags); in xhci_suspend()
914 del_timer_sync(&hcd->rh_timer); in xhci_suspend()
919 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); in xhci_suspend()
984 struct usb_hcd *hcd = xhci_to_hcd(xhci); in xhci_resume() local
989 if (!hcd->state) in xhci_resume()
1000 set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); in xhci_resume()
1062 if (!usb_hcd_is_primary_hcd(hcd)) in xhci_resume()
1063 secondary_hcd = hcd; in xhci_resume()
1068 retval = xhci_init(hcd->primary_hcd); in xhci_resume()
1074 retval = xhci_run(hcd->primary_hcd); in xhci_resume()
1079 hcd->state = HC_STATE_SUSPENDED; in xhci_resume()
1108 usb_hcd_resume_root_hub(hcd); in xhci_resume()
1125 set_bit(HCD_FLAG_POLL_RH, &hcd->flags); in xhci_resume()
1126 usb_hcd_poll_rh_status(hcd); in xhci_resume()
1198 static int xhci_check_args(struct usb_hcd *hcd, struct usb_device *udev, in xhci_check_args() argument
1204 if (!hcd || (check_ep && !ep) || !udev) { in xhci_check_args()
1213 xhci = hcd_to_xhci(hcd); in xhci_check_args()
1323 int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags) in xhci_urb_enqueue() argument
1325 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_urb_enqueue()
1333 if (!urb || xhci_check_args(hcd, urb->dev, urb->ep, in xhci_urb_enqueue()
1340 if (!HCD_HW_ACCESSIBLE(hcd)) { in xhci_urb_enqueue()
1529 int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) in xhci_urb_dequeue() argument
1542 xhci = hcd_to_xhci(hcd); in xhci_urb_dequeue()
1545 ret = usb_hcd_check_unlink_urb(hcd, urb, status); in xhci_urb_dequeue()
1563 usb_hcd_unlink_urb_from_ep(hcd, urb); in xhci_urb_dequeue()
1565 usb_hcd_giveback_urb(hcd, urb, -ESHUTDOWN); in xhci_urb_dequeue()
1644 int xhci_drop_endpoint(struct usb_hcd *hcd, struct usb_device *udev, in xhci_drop_endpoint() argument
1656 ret = xhci_check_args(hcd, udev, ep, 1, true, __func__); in xhci_drop_endpoint()
1659 xhci = hcd_to_xhci(hcd); in xhci_drop_endpoint()
1725 int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev, in xhci_add_endpoint() argument
1737 ret = xhci_check_args(hcd, udev, ep, 1, true, __func__); in xhci_add_endpoint()
1743 xhci = hcd_to_xhci(hcd); in xhci_add_endpoint()
2743 int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) in xhci_check_bandwidth() argument
2753 ret = xhci_check_args(hcd, udev, NULL, 0, true, __func__); in xhci_check_bandwidth()
2756 xhci = hcd_to_xhci(hcd); in xhci_check_bandwidth()
2847 void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) in xhci_reset_bandwidth() argument
2853 ret = xhci_check_args(hcd, udev, NULL, 0, true, __func__); in xhci_reset_bandwidth()
2856 xhci = hcd_to_xhci(hcd); in xhci_reset_bandwidth()
2973 void xhci_endpoint_reset(struct usb_hcd *hcd, in xhci_endpoint_reset() argument
2978 xhci = hcd_to_xhci(hcd); in xhci_endpoint_reset()
3149 int xhci_alloc_streams(struct usb_hcd *hcd, struct usb_device *udev, in xhci_alloc_streams() argument
3170 xhci = hcd_to_xhci(hcd); in xhci_alloc_streams()
3310 int xhci_free_streams(struct usb_hcd *hcd, struct usb_device *udev, in xhci_free_streams() argument
3323 xhci = hcd_to_xhci(hcd); in xhci_free_streams()
3442 int xhci_discover_or_reset_device(struct usb_hcd *hcd, struct usb_device *udev) in xhci_discover_or_reset_device() argument
3454 ret = xhci_check_args(hcd, udev, NULL, 0, false, __func__); in xhci_discover_or_reset_device()
3457 xhci = hcd_to_xhci(hcd); in xhci_discover_or_reset_device()
3463 ret = xhci_alloc_dev(hcd, udev); in xhci_discover_or_reset_device()
3481 ret = xhci_alloc_dev(hcd, udev); in xhci_discover_or_reset_device()
3605 void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev) in xhci_free_dev() argument
3607 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_free_dev()
3625 pm_runtime_put_noidle(hcd->self.controller); in xhci_free_dev()
3628 ret = xhci_check_args(hcd, udev, NULL, 0, true, __func__); in xhci_free_dev()
3698 int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev) in xhci_alloc_dev() argument
3700 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_alloc_dev()
3765 pm_runtime_get_noresume(hcd->self.controller); in xhci_alloc_dev()
3790 static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev, in xhci_setup_device() argument
3797 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_setup_device()
3967 int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev) in xhci_address_device() argument
3969 return xhci_setup_device(hcd, udev, SETUP_CONTEXT_ADDRESS); in xhci_address_device()
3972 int xhci_enable_device(struct usb_hcd *hcd, struct usb_device *udev) in xhci_enable_device() argument
3974 return xhci_setup_device(hcd, udev, SETUP_CONTEXT_ONLY); in xhci_enable_device()
3983 int xhci_find_raw_port_number(struct usb_hcd *hcd, int port1) in xhci_find_raw_port_number() argument
3985 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_find_raw_port_number()
3990 if (hcd->speed < HCD_USB3) in xhci_find_raw_port_number()
4129 int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd, in xhci_set_usb2_hardware_lpm() argument
4132 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_set_usb2_hardware_lpm()
4141 if (hcd->speed >= HCD_USB3 || !xhci->hw_lpm_support || in xhci_set_usb2_hardware_lpm()
4187 mutex_lock(hcd->bandwidth_mutex); in xhci_set_usb2_hardware_lpm()
4190 mutex_unlock(hcd->bandwidth_mutex); in xhci_set_usb2_hardware_lpm()
4219 mutex_lock(hcd->bandwidth_mutex); in xhci_set_usb2_hardware_lpm()
4221 mutex_unlock(hcd->bandwidth_mutex); in xhci_set_usb2_hardware_lpm()
4253 int xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev) in xhci_update_device() argument
4255 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_update_device()
4258 if (hcd->speed >= HCD_USB3 || !xhci->sw_lpm_support || in xhci_update_device()
4551 static u16 xhci_calculate_lpm_timeout(struct usb_hcd *hcd, in xhci_calculate_lpm_timeout() argument
4554 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_calculate_lpm_timeout()
4662 int xhci_enable_usb3_lpm_timeout(struct usb_hcd *hcd, in xhci_enable_usb3_lpm_timeout() argument
4670 xhci = hcd_to_xhci(hcd); in xhci_enable_usb3_lpm_timeout()
4679 hub_encoded_timeout = xhci_calculate_lpm_timeout(hcd, udev, state); in xhci_enable_usb3_lpm_timeout()
4693 int xhci_disable_usb3_lpm_timeout(struct usb_hcd *hcd, in xhci_disable_usb3_lpm_timeout() argument
4699 xhci = hcd_to_xhci(hcd); in xhci_disable_usb3_lpm_timeout()
4709 int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd, in xhci_set_usb2_hardware_lpm() argument
4715 int xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev) in xhci_update_device() argument
4720 int xhci_enable_usb3_lpm_timeout(struct usb_hcd *hcd, in xhci_enable_usb3_lpm_timeout() argument
4726 int xhci_disable_usb3_lpm_timeout(struct usb_hcd *hcd, in xhci_disable_usb3_lpm_timeout() argument
4738 int xhci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev, in xhci_update_hub_device() argument
4741 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_update_hub_device()
4844 int xhci_get_frame(struct usb_hcd *hcd) in xhci_get_frame() argument
4846 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_get_frame()
4851 int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks) in xhci_gen_setup() argument
4854 struct device *dev = hcd->self.controller; in xhci_gen_setup()
4858 hcd->self.sg_tablesize = ~0; in xhci_gen_setup()
4861 hcd->self.no_sg_constraint = 1; in xhci_gen_setup()
4864 hcd->self.no_stop_on_short = 1; in xhci_gen_setup()
4866 xhci = hcd_to_xhci(hcd); in xhci_gen_setup()
4868 if (usb_hcd_is_primary_hcd(hcd)) { in xhci_gen_setup()
4869 xhci->main_hcd = hcd; in xhci_gen_setup()
4873 hcd->speed = HCD_USB2; in xhci_gen_setup()
4874 hcd->self.root_hub->speed = USB_SPEED_HIGH; in xhci_gen_setup()
4880 hcd->has_tt = 1; in xhci_gen_setup()
4884 hcd->speed = HCD_USB31; in xhci_gen_setup()
4893 xhci->cap_regs = hcd->regs; in xhci_gen_setup()
4894 xhci->op_regs = hcd->regs + in xhci_gen_setup()
4896 xhci->run_regs = hcd->regs + in xhci_gen_setup()
4952 retval = xhci_init(hcd); in xhci_gen_setup()