Lines Matching refs:hcd

285 	struct usb_hcd	*hcd,  in rh_string()  argument
299 strcpy (buf, hcd->bus->bus_name); in rh_string()
303 strcpy (buf, hcd->product_desc); in rh_string()
308 hcd->description); in rh_string()
321 static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) in rh_call_control() argument
361 if (hcd->driver->flags & HCD_USB2) in rh_call_control()
363 else if (hcd->driver->flags & HCD_USB11) in rh_call_control()
370 if (hcd->driver->flags & HCD_USB2) { in rh_call_control()
380 wValue & 0xff, hcd, in rh_call_control()
395 hcd->bus->bus_name, wValue); in rh_call_control()
416 urb->status = hcd->driver->hub_control (hcd, in rh_call_control()
440 usb_hcd_giveback_urb (hcd, urb, 0); in rh_call_control()
453 static int rh_status_urb (struct usb_hcd *hcd, struct urb *urb) in rh_status_urb() argument
458 if (timer_pending (&hcd->rh_timer) in rh_status_urb()
460 || !HCD_IS_RUNNING (hcd->state) in rh_status_urb()
466 urb->hcpriv = hcd; /* nonzero to indicate it's queued */ in rh_status_urb()
467 init_timer (&hcd->rh_timer); in rh_status_urb()
468 hcd->rh_timer.function = rh_report_status; in rh_status_urb()
469 hcd->rh_timer.data = (unsigned long) urb; in rh_status_urb()
471 hcd->rh_timer.expires = jiffies + HZ/4; in rh_status_urb()
472 add_timer (&hcd->rh_timer); in rh_status_urb()
481 struct usb_hcd *hcd; in rh_report_status() local
492 hcd = urb->dev->bus->hcpriv; in rh_report_status()
494 if (HCD_IS_RUNNING (hcd->state)) { in rh_report_status()
495 length = hcd->driver->hub_status_data (hcd, in rh_report_status()
505 if (HCD_IS_RUNNING (hcd->state) in rh_report_status()
506 && rh_status_urb (hcd, urb) != 0) { in rh_report_status()
509 hcd->bus->bus_name); in rh_report_status()
521 usb_hcd_giveback_urb (hcd, urb, 0); in rh_report_status()
527 static int rh_urb_enqueue (struct usb_hcd *hcd, struct urb *urb) in rh_urb_enqueue() argument
534 retval = rh_status_urb (hcd, urb); in rh_urb_enqueue()
539 return rh_call_control (hcd, urb); in rh_urb_enqueue()
546 static void rh_status_dequeue (struct usb_hcd *hcd, struct urb *urb) in rh_status_dequeue() argument
551 del_timer_sync (&hcd->rh_timer); in rh_status_dequeue()
552 hcd->rh_timer.data = 0; in rh_status_dequeue()
556 usb_hcd_giveback_urb (hcd, urb, 0); in rh_status_dequeue()
566 static void hc_died (struct usb_hcd *hcd);
591 struct usb_hcd *hcd; in usb_hcd_pci_probe() local
648 hcd = driver->hcd_alloc (); in usb_hcd_pci_probe()
649 if (hcd == NULL){ in usb_hcd_pci_probe()
662 pci_set_drvdata(dev, hcd); in usb_hcd_pci_probe()
663 hcd->driver = driver; in usb_hcd_pci_probe()
664 hcd->description = driver->description; in usb_hcd_pci_probe()
665 hcd->pdev = dev; in usb_hcd_pci_probe()
667 hcd->description, dev->slot_name, dev->name); in usb_hcd_pci_probe()
674 if (request_irq (dev->irq, hcd_irq, SA_SHIRQ, hcd->description, hcd) in usb_hcd_pci_probe()
679 driver->hcd_free (hcd); in usb_hcd_pci_probe()
682 hcd->irq = dev->irq; in usb_hcd_pci_probe()
684 hcd->regs = base; in usb_hcd_pci_probe()
685 hcd->region = region; in usb_hcd_pci_probe()
687 hcd->description, dev->slot_name, bufp, in usb_hcd_pci_probe()
697 free_irq (dev->irq, hcd); in usb_hcd_pci_probe()
700 hcd->bus = bus; in usb_hcd_pci_probe()
702 hcd->product_desc = dev->name; in usb_hcd_pci_probe()
703 bus->hcpriv = (void *) hcd; in usb_hcd_pci_probe()
705 INIT_LIST_HEAD (&hcd->dev_list); in usb_hcd_pci_probe()
706 INIT_LIST_HEAD (&hcd->hcd_list); in usb_hcd_pci_probe()
709 list_add (&hcd->hcd_list, &hcd_list); in usb_hcd_pci_probe()
714 if ((retval = driver->start (hcd)) < 0) in usb_hcd_pci_probe()
738 struct usb_hcd *hcd; in usb_hcd_pci_remove() local
741 hcd = pci_get_drvdata(dev); in usb_hcd_pci_remove()
742 if (!hcd) in usb_hcd_pci_remove()
745 hcd->description, dev->slot_name, hcd->state); in usb_hcd_pci_remove()
749 hub = hcd->bus->root_hub; in usb_hcd_pci_remove()
750 hcd->state = USB_STATE_QUIESCING; in usb_hcd_pci_remove()
752 dbg ("%s: roothub graceful disconnect", hcd->bus->bus_name); in usb_hcd_pci_remove()
756 hcd->driver->stop (hcd); in usb_hcd_pci_remove()
757 hcd->state = USB_STATE_HALT; in usb_hcd_pci_remove()
759 free_irq (hcd->irq, hcd); in usb_hcd_pci_remove()
760 if (hcd->driver->flags & HCD_MEMORY) { in usb_hcd_pci_remove()
761 iounmap (hcd->regs); in usb_hcd_pci_remove()
765 release_region (pci_resource_start (dev, hcd->region), in usb_hcd_pci_remove()
766 pci_resource_len (dev, hcd->region)); in usb_hcd_pci_remove()
770 list_del (&hcd->hcd_list); in usb_hcd_pci_remove()
773 usb_deregister_bus (hcd->bus); in usb_hcd_pci_remove()
774 usb_free_bus (hcd->bus); in usb_hcd_pci_remove()
775 hcd->bus = NULL; in usb_hcd_pci_remove()
777 hcd->driver->hcd_free (hcd); in usb_hcd_pci_remove()
819 struct usb_hcd *hcd; in usb_hcd_pci_suspend() local
822 hcd = pci_get_drvdata(dev); in usb_hcd_pci_suspend()
824 hcd->description, dev->slot_name, state); in usb_hcd_pci_suspend()
826 pci_save_state (dev, hcd->pci_state); in usb_hcd_pci_suspend()
833 retval = hcd->driver->suspend (hcd, state); in usb_hcd_pci_suspend()
834 hcd->state = USB_STATE_SUSPENDED; in usb_hcd_pci_suspend()
849 struct usb_hcd *hcd; in usb_hcd_pci_resume() local
852 hcd = pci_get_drvdata(dev); in usb_hcd_pci_resume()
854 hcd->description, dev->slot_name); in usb_hcd_pci_resume()
857 atomic_inc (&hcd->resume_count); in usb_hcd_pci_resume()
858 if (atomic_read (&hcd->resume_count) != 1) { in usb_hcd_pci_resume()
859 err ("concurrent PCI resumes for %s", hcd->bus->bus_name); in usb_hcd_pci_resume()
865 if (hcd->state != USB_STATE_SUSPENDED) { in usb_hcd_pci_resume()
869 hcd->state = USB_STATE_RESUMING; in usb_hcd_pci_resume()
872 pci_restore_state (dev, hcd->pci_state); in usb_hcd_pci_resume()
874 retval = hcd->driver->resume (hcd); in usb_hcd_pci_resume()
875 if (!HCD_IS_RUNNING (hcd->state)) { in usb_hcd_pci_resume()
877 hcd->bus->bus_name, retval); in usb_hcd_pci_resume()
878 hc_died (hcd); in usb_hcd_pci_resume()
887 atomic_dec (&hcd->resume_count); in usb_hcd_pci_resume()
908 struct usb_hcd *hcd; in hcd_alloc_dev() local
915 hcd = udev->bus->hcpriv; in hcd_alloc_dev()
916 if (hcd->state == USB_STATE_QUIESCING) in hcd_alloc_dev()
928 list_add (&dev->dev_list, &hcd->dev_list); in hcd_alloc_dev()
940 struct usb_hcd *hcd = _hcd; in hcd_panic() local
941 hcd->driver->stop (hcd); in hcd_panic()
944 static void hc_died (struct usb_hcd *hcd) in hc_died() argument
953 list_for_each (devlist, &hcd->dev_list) { in hc_died()
958 hcd->bus->bus_name, in hc_died()
964 urb = (struct urb *) hcd->rh_timer.data; in hc_died()
970 rh_status_dequeue (hcd, urb); in hc_died()
973 INIT_TQUEUE (&hcd->work, hcd_panic, hcd); in hc_died()
974 (void) schedule_task (&hcd->work); in hc_died()
1006 struct usb_hcd *hcd; in hcd_submit_urb() local
1022 hcd = urb->dev->bus->hcpriv; in hcd_submit_urb()
1024 if (!hcd || !dev) in hcd_submit_urb()
1028 if (hcd->state == USB_STATE_QUIESCING || !HCD_IS_RUNNING (hcd->state)) in hcd_submit_urb()
1191 if (HCD_IS_RUNNING (hcd->state) && hcd->state != USB_STATE_QUIESCING) { in hcd_submit_urb()
1206 if (urb->dev == hcd->bus->root_hub) { in hcd_submit_urb()
1207 status = rh_urb_enqueue (hcd, urb); in hcd_submit_urb()
1211 hcd->pdev, in hcd_submit_urb()
1217 hcd->pdev, in hcd_submit_urb()
1223 status = hcd->driver->urb_enqueue (hcd, urb, mem_flags); in hcd_submit_urb()
1233 struct usb_hcd *hcd = (struct usb_hcd *)udev->bus->hcpriv; in hcd_get_frame_number() local
1234 return hcd->driver->get_frame_number (hcd); in hcd_get_frame_number()
1272 struct usb_hcd *hcd = 0; in hcd_unlink_urb() local
1305 hcd = urb->dev->bus->hcpriv; in hcd_unlink_urb()
1306 if (!dev || !hcd) { in hcd_unlink_urb()
1355 if (urb == (struct urb *) hcd->rh_timer.data) { in hcd_unlink_urb()
1356 rh_status_dequeue (hcd, urb); in hcd_unlink_urb()
1359 retval = hcd->driver->urb_dequeue (hcd, urb); in hcd_unlink_urb()
1366 && HCD_IS_RUNNING (hcd->state) in hcd_unlink_urb()
1379 hcd ? hcd->bus->bus_name : "(no bus?)", in hcd_unlink_urb()
1395 struct usb_hcd *hcd; in hcd_free_dev() local
1407 hcd = udev->bus->hcpriv; in hcd_free_dev()
1412 hcd->bus->bus_name, udev->devnum); in hcd_free_dev()
1416 hcd->driver->free_config (hcd, udev); in hcd_free_dev()
1439 struct usb_hcd *hcd = __hcd; in hcd_irq() local
1440 int start = hcd->state; in hcd_irq()
1442 if (unlikely (hcd->state == USB_STATE_HALT)) /* irq sharing? */ in hcd_irq()
1445 hcd->driver->irq (hcd, r); in hcd_irq()
1446 if (hcd->state != start && hcd->state == USB_STATE_HALT) in hcd_irq()
1447 hc_died (hcd); in hcd_irq()
1474 void usb_hcd_giveback_urb (struct usb_hcd *hcd, struct urb *urb, struct pt_regs *regs) in usb_hcd_giveback_urb() argument
1479 is_root_hub_operation = (urb->dev == hcd->bus->root_hub); in usb_hcd_giveback_urb()
1493 pci_unmap_single (hcd->pdev, urb->setup_dma, in usb_hcd_giveback_urb()
1498 pci_unmap_single (hcd->pdev, urb->transfer_dma, in usb_hcd_giveback_urb()