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()
669 static void xhci_only_stop_hcd(struct usb_hcd *hcd) in xhci_only_stop_hcd() argument
671 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_only_stop_hcd()
693 void xhci_stop(struct usb_hcd *hcd) in xhci_stop() argument
696 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_stop()
700 if (!usb_hcd_is_primary_hcd(hcd)) { in xhci_stop()
753 void xhci_shutdown(struct usb_hcd *hcd) in xhci_shutdown() argument
755 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_shutdown()
758 usb_disable_xhci_ports(to_pci_dev(hcd->self.controller)); in xhci_shutdown()
775 pci_set_power_state(to_pci_dev(hcd->self.controller), PCI_D3hot); in xhci_shutdown()
913 struct usb_hcd *hcd = xhci_to_hcd(xhci); in xhci_suspend() local
916 if (hcd->state != HC_STATE_SUSPENDED || in xhci_suspend()
926 clear_bit(HCD_FLAG_POLL_RH, &hcd->flags); in xhci_suspend()
927 del_timer_sync(&hcd->rh_timer); in xhci_suspend()
932 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); in xhci_suspend()
997 struct usb_hcd *hcd = xhci_to_hcd(xhci); in xhci_resume() local
1010 set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); in xhci_resume()
1072 if (!usb_hcd_is_primary_hcd(hcd)) in xhci_resume()
1073 secondary_hcd = hcd; in xhci_resume()
1078 retval = xhci_init(hcd->primary_hcd); in xhci_resume()
1084 retval = xhci_run(hcd->primary_hcd); in xhci_resume()
1089 hcd->state = HC_STATE_SUSPENDED; in xhci_resume()
1118 usb_hcd_resume_root_hub(hcd); in xhci_resume()
1135 set_bit(HCD_FLAG_POLL_RH, &hcd->flags); in xhci_resume()
1136 usb_hcd_poll_rh_status(hcd); in xhci_resume()
1208 static int xhci_check_args(struct usb_hcd *hcd, struct usb_device *udev, in xhci_check_args() argument
1214 if (!hcd || (check_ep && !ep) || !udev) { in xhci_check_args()
1223 xhci = hcd_to_xhci(hcd); in xhci_check_args()
1333 int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags) in xhci_urb_enqueue() argument
1335 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_urb_enqueue()
1343 if (!urb || xhci_check_args(hcd, urb->dev, urb->ep, in xhci_urb_enqueue()
1350 if (!HCD_HW_ACCESSIBLE(hcd)) { in xhci_urb_enqueue()
1539 int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) in xhci_urb_dequeue() argument
1552 xhci = hcd_to_xhci(hcd); in xhci_urb_dequeue()
1555 ret = usb_hcd_check_unlink_urb(hcd, urb, status); in xhci_urb_dequeue()
1573 usb_hcd_unlink_urb_from_ep(hcd, urb); in xhci_urb_dequeue()
1575 usb_hcd_giveback_urb(hcd, urb, -ESHUTDOWN); in xhci_urb_dequeue()
1654 int xhci_drop_endpoint(struct usb_hcd *hcd, struct usb_device *udev, in xhci_drop_endpoint() argument
1666 ret = xhci_check_args(hcd, udev, ep, 1, true, __func__); in xhci_drop_endpoint()
1669 xhci = hcd_to_xhci(hcd); in xhci_drop_endpoint()
1735 int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev, in xhci_add_endpoint() argument
1747 ret = xhci_check_args(hcd, udev, ep, 1, true, __func__); in xhci_add_endpoint()
1753 xhci = hcd_to_xhci(hcd); in xhci_add_endpoint()
2753 int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) in xhci_check_bandwidth() argument
2763 ret = xhci_check_args(hcd, udev, NULL, 0, true, __func__); in xhci_check_bandwidth()
2766 xhci = hcd_to_xhci(hcd); in xhci_check_bandwidth()
2857 void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) in xhci_reset_bandwidth() argument
2863 ret = xhci_check_args(hcd, udev, NULL, 0, true, __func__); in xhci_reset_bandwidth()
2866 xhci = hcd_to_xhci(hcd); in xhci_reset_bandwidth()
2983 void xhci_endpoint_reset(struct usb_hcd *hcd, in xhci_endpoint_reset() argument
2988 xhci = hcd_to_xhci(hcd); in xhci_endpoint_reset()
3159 int xhci_alloc_streams(struct usb_hcd *hcd, struct usb_device *udev, in xhci_alloc_streams() argument
3180 xhci = hcd_to_xhci(hcd); in xhci_alloc_streams()
3320 int xhci_free_streams(struct usb_hcd *hcd, struct usb_device *udev, in xhci_free_streams() argument
3333 xhci = hcd_to_xhci(hcd); in xhci_free_streams()
3452 int xhci_discover_or_reset_device(struct usb_hcd *hcd, struct usb_device *udev) in xhci_discover_or_reset_device() argument
3464 ret = xhci_check_args(hcd, udev, NULL, 0, false, __func__); in xhci_discover_or_reset_device()
3467 xhci = hcd_to_xhci(hcd); in xhci_discover_or_reset_device()
3473 ret = xhci_alloc_dev(hcd, udev); in xhci_discover_or_reset_device()
3491 ret = xhci_alloc_dev(hcd, udev); in xhci_discover_or_reset_device()
3615 void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev) in xhci_free_dev() argument
3617 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_free_dev()
3635 pm_runtime_put_noidle(hcd->self.controller); in xhci_free_dev()
3638 ret = xhci_check_args(hcd, udev, NULL, 0, true, __func__); in xhci_free_dev()
3708 int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev) in xhci_alloc_dev() argument
3710 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_alloc_dev()
3775 pm_runtime_get_noresume(hcd->self.controller); in xhci_alloc_dev()
3802 static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev, in xhci_setup_device() argument
3809 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_setup_device()
3979 int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev) in xhci_address_device() argument
3981 return xhci_setup_device(hcd, udev, SETUP_CONTEXT_ADDRESS); in xhci_address_device()
3984 int xhci_enable_device(struct usb_hcd *hcd, struct usb_device *udev) in xhci_enable_device() argument
3986 return xhci_setup_device(hcd, udev, SETUP_CONTEXT_ONLY); in xhci_enable_device()
3995 int xhci_find_raw_port_number(struct usb_hcd *hcd, int port1) in xhci_find_raw_port_number() argument
3997 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_find_raw_port_number()
4002 if (hcd->speed != HCD_USB3) in xhci_find_raw_port_number()
4141 int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd, in xhci_set_usb2_hardware_lpm() argument
4144 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_set_usb2_hardware_lpm()
4153 if (hcd->speed == HCD_USB3 || !xhci->hw_lpm_support || in xhci_set_usb2_hardware_lpm()
4199 mutex_lock(hcd->bandwidth_mutex); in xhci_set_usb2_hardware_lpm()
4202 mutex_unlock(hcd->bandwidth_mutex); in xhci_set_usb2_hardware_lpm()
4231 mutex_lock(hcd->bandwidth_mutex); in xhci_set_usb2_hardware_lpm()
4233 mutex_unlock(hcd->bandwidth_mutex); in xhci_set_usb2_hardware_lpm()
4265 int xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev) in xhci_update_device() argument
4267 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_update_device()
4270 if (hcd->speed == HCD_USB3 || !xhci->sw_lpm_support || in xhci_update_device()
4563 static u16 xhci_calculate_lpm_timeout(struct usb_hcd *hcd, in xhci_calculate_lpm_timeout() argument
4566 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_calculate_lpm_timeout()
4674 int xhci_enable_usb3_lpm_timeout(struct usb_hcd *hcd, in xhci_enable_usb3_lpm_timeout() argument
4682 xhci = hcd_to_xhci(hcd); in xhci_enable_usb3_lpm_timeout()
4691 hub_encoded_timeout = xhci_calculate_lpm_timeout(hcd, udev, state); in xhci_enable_usb3_lpm_timeout()
4705 int xhci_disable_usb3_lpm_timeout(struct usb_hcd *hcd, in xhci_disable_usb3_lpm_timeout() argument
4712 xhci = hcd_to_xhci(hcd); in xhci_disable_usb3_lpm_timeout()
4725 int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd, in xhci_set_usb2_hardware_lpm() argument
4731 int xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev) in xhci_update_device() argument
4736 int xhci_enable_usb3_lpm_timeout(struct usb_hcd *hcd, in xhci_enable_usb3_lpm_timeout() argument
4742 int xhci_disable_usb3_lpm_timeout(struct usb_hcd *hcd, in xhci_disable_usb3_lpm_timeout() argument
4754 int xhci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev, in xhci_update_hub_device() argument
4757 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_update_hub_device()
4860 int xhci_get_frame(struct usb_hcd *hcd) in xhci_get_frame() argument
4862 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_get_frame()
4867 int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks) in xhci_gen_setup() argument
4870 struct device *dev = hcd->self.controller; in xhci_gen_setup()
4874 hcd->self.sg_tablesize = ~0; in xhci_gen_setup()
4877 hcd->self.no_sg_constraint = 1; in xhci_gen_setup()
4880 hcd->self.no_stop_on_short = 1; in xhci_gen_setup()
4882 if (usb_hcd_is_primary_hcd(hcd)) { in xhci_gen_setup()
4886 *((struct xhci_hcd **) hcd->hcd_priv) = xhci; in xhci_gen_setup()
4887 xhci->main_hcd = hcd; in xhci_gen_setup()
4891 hcd->speed = HCD_USB2; in xhci_gen_setup()
4892 hcd->self.root_hub->speed = USB_SPEED_HIGH; in xhci_gen_setup()
4898 hcd->has_tt = 1; in xhci_gen_setup()
4907 xhci->cap_regs = hcd->regs; in xhci_gen_setup()
4908 xhci->op_regs = hcd->regs + in xhci_gen_setup()
4910 xhci->run_regs = hcd->regs + in xhci_gen_setup()
4964 retval = xhci_init(hcd); in xhci_gen_setup()