Lines Matching refs:ehci
251 extern void ehci_StopRun_Setting(MS_U8 bOption, struct ehci_hcd *ehci);
324 static int ehci_halt (struct ehci_hcd *ehci) in ehci_halt() argument
326 U32 temp = ehci_readl ((U32)&ehci->regs->status); in ehci_halt()
379 temp = ehci_readl ((U32)&ehci->regs->command); in ehci_halt()
381 ehci_writel (temp, (U32)&ehci->regs->command); in ehci_halt()
383 return handshake (&ehci->regs->status, STS_HALT, STS_HALT, 16 * 125); in ehci_halt()
387 static int ehci_reset (struct ehci_hcd *ehci) in ehci_reset() argument
389 U32 command = ehci_readl ((U32)&ehci->regs->command); in ehci_reset()
393 dbg_cmd (ehci, "reset", command); in ehci_reset()
394 ehci_writel (command, (U32)&ehci->regs->command); in ehci_reset()
395 ehci->hcd.state = USB_STATE_HALT; in ehci_reset()
446 command = handshake (&ehci->regs->command, CMD_RESET, 0, 250 * 1000); in ehci_reset()
455 static void ehci_ready (struct ehci_hcd *ehci) in ehci_ready() argument
460 if (!HCD_IS_RUNNING (ehci->hcd.state)) in ehci_ready()
467 if (ehci->async->qh_next.qh) in ehci_ready()
469 if (ehci->next_uframe != -1) in ehci_ready()
471 if (handshake (&ehci->regs->status, STS_ASS | STS_PSS, in ehci_ready()
473 ehci->hcd.state = USB_STATE_HALT; in ehci_ready()
474 printk("Got problem,check it out, qHD is %p\n",ehci->async->qh_next.qh); in ehci_ready()
530 temp = ehci_readl ((U32)&ehci->regs->command); in ehci_ready()
532 ehci_writel (temp, (U32)&ehci->regs->command); in ehci_ready()
535 if (handshake (&ehci->regs->status, STS_ASS | STS_PSS, in ehci_ready()
538 ehci->hcd.state = USB_STATE_HALT; in ehci_ready()
551 struct ehci_hcd *ehci, in check_reset_complete() argument
556 ehci->reset_done [index] = 0; in check_reset_complete()
612 ehci_dbg (ehci, "port %d full speed --> companion%s", in check_reset_complete()
617 ehci_writel (port_status, (U32)&ehci->regs->port_status [index]); in check_reset_complete()
619 ehci_dbg (ehci, "port %d high speed%s", index + 1,"\n"); in check_reset_complete()
679 struct ehci_hcd *ehci = hcd_to_ehci (hcd); in ehci_hub_status_data() local
686 ports = HCS_N_PORTS (ehci->hcs_params); in ehci_hub_status_data()
743 spin_lock_irqsave (&ehci->lock, flags); in ehci_hub_status_data()
745 temp = ehci_readl ((U32)&ehci->regs->port_status[i]); in ehci_hub_status_data()
809 ehci_writel (temp, (U32)&ehci->regs->port_status [i]); in ehci_hub_status_data()
815 ehci->reset_done [i] = 0; in ehci_hub_status_data()
976 spin_unlock_irqrestore (&ehci->lock, flags); in ehci_hub_status_data()
1032 struct ehci_hcd *ehci, in ehci_hub_descriptor() argument
1035 int ports = HCS_N_PORTS (ehci->hcs_params); in ehci_hub_descriptor()
1195 if (HCS_PPC (ehci->hcs_params)) in ehci_hub_descriptor()
1197 if (HCS_INDICATOR (ehci->hcs_params)) in ehci_hub_descriptor()
1203 void ehci_hc_swreset(struct ehci_hcd *ehci) in ehci_hc_swreset() argument
1214 regTmp[0] = ehci_readl((U32)&ehci->regs->command); in ehci_hc_swreset()
1215 regTmp[1] = ehci_readl((U32)&ehci->regs->intr_enable); in ehci_hc_swreset()
1217 ehci_reset(ehci); in ehci_hc_swreset()
1235 ehci_writel(regTmp[1],(U32)&ehci->regs->intr_enable); in ehci_hc_swreset()
1236 ehci_writel(regTmp[0],(U32)&ehci->regs->command); in ehci_hc_swreset()
1237 ehci->hcd.state = USB_STATE_RUNNING; in ehci_hc_swreset()
1260 struct ehci_hcd *ehci = hcd_to_ehci (hcd); in ehci_hub_control() local
1261 int ports = HCS_N_PORTS (ehci->hcs_params); in ehci_hub_control()
1320 spin_lock_irqsave (&ehci->lock, flags); in ehci_hub_control()
1336 temp = ehci_readl ((U32)&ehci->regs->port_status [wIndex]); in ehci_hub_control()
1343 if( ehci->async->qh_next.qh != 0 ) in ehci_hub_control()
1345 …_err("Not only cantain one qHD (%p and %p)in asyn. scheduler",ehci->async->qh_next.qh,ehci->async); in ehci_hub_control()
1347 ehci_writel (temp & ~PORT_PE, (U32)&ehci->regs->port_status [wIndex]); in ehci_hub_control()
1350 …ehci_writel(ehci_readl((U32)&ehci->regs->command)&(~(CMD_ASE|CMD_PSE|CMD_IAAD)),(U32)&ehci->regs->… in ehci_hub_control()
1401 ehci_halt(ehci); in ehci_hub_control()
1402 ehci_hc_swreset(ehci); in ehci_hub_control()
1406 (U32)&ehci->regs->port_status [wIndex]); in ehci_hub_control()
1413 if (HCS_PPC (ehci->hcs_params)) in ehci_hub_control()
1415 (U32)&ehci->regs->port_status [wIndex]); in ehci_hub_control()
1419 (U32)&ehci->regs->port_status [wIndex]); in ehci_hub_control()
1472 (U32)&ehci->regs->port_status [wIndex]); in ehci_hub_control()
1480 temp = ehci_readl ((U32)&ehci->regs->command); /* unblock posted write */ in ehci_hub_control()
1483 ehci_hub_descriptor (ehci, (struct usb_hub_descriptor *) in ehci_hub_control()
1545 temp = ehci_readl ((U32)&ehci->regs->port_status [wIndex]); in ehci_hub_control()
1569 ehci->reset_done [wIndex])) { in ehci_hub_control()
1578 (U32)&ehci->regs->port_status [wIndex]); in ehci_hub_control()
1581 (U32)&ehci->regs->port_status [wIndex]); in ehci_hub_control()
1595 ehci_hc_swreset(ehci); in ehci_hub_control()
1598 speed = (ehci_readl((U32)&ehci->regs->bus_control) >> 9) & 0x3; in ehci_hub_control()
1601 temp2 = ehci_readl((U32)&ehci->regs->hcmisc) & 0xfffffff3; in ehci_hub_control()
1612 ehci_writel (temp2, (U32)&ehci->regs->hcmisc); // misc, EOF1 in ehci_hub_control()
1614 temp = check_reset_complete (ehci, wIndex, temp); in ehci_hub_control()
1621 bus_monitor=ehci_readl ((U32)&ehci->regs->bus_control); in ehci_hub_control()
1694 dbg_port (ehci, "GetStatus", wIndex + 1, temp); in ehci_hub_control()
1768 temp = ehci_readl ((U32)&ehci->regs->port_status [wIndex]); in ehci_hub_control()
1779 (U32)&ehci->regs->port_status [wIndex]); in ehci_hub_control()
1782 if (HCS_PPC (ehci->hcs_params)) in ehci_hub_control()
1784 (U32)&ehci->regs->port_status [wIndex]); in ehci_hub_control()
1794 ehci_dbg (ehci, in ehci_hub_control()
1801 ehci_vdbg (ehci, "port %d reset %s", wIndex + 1,"\n"); in ehci_hub_control()
1809 ehci->reset_done [wIndex] = jiffies in ehci_hub_control()
1818 …ehci_writel(ehci_readl((U32)&ehci->regs->command)&(~(CMD_RUN|CMD_ASE|CMD_PSE)),(U32)&ehci->regs->c… in ehci_hub_control()
1821 while(((ehci_readl((U32)&ehci->regs->status)&STS_HALT) == 0)&&(time_out++<1000)); in ehci_hub_control()
1825 ehci_hc_swreset(ehci); in ehci_hub_control()
1837 …ehci_writel(ehci_readl((U32)&ehci->regs->command)&(~(CMD_RUN|CMD_ASE|CMD_PSE)),(U32)&ehci->regs->c… in ehci_hub_control()
1840 while(((ehci_readl((U32)&ehci->regs->status)&STS_HALT) == 0)&&(time_out++<1000)); in ehci_hub_control()
1844 ehci_hc_swreset(ehci); in ehci_hub_control()
1856 ehci_StopRun_Setting(HOST20_Enable, ehci); in ehci_hub_control()
1863 ehci_writel (temp, (U32)&ehci->regs->port_status [wIndex]); // port reset in ehci_hub_control()
1869 temp = ehci_readl ((U32)&ehci->regs->command); /* unblock posted writes */ in ehci_hub_control()
1877 spin_unlock_irqrestore (&ehci->lock, flags); in ehci_hub_control()
2161 qh_update (struct ehci_hcd *ehci, struct ehci_qh *qh, struct ehci_qtd *qtd) in qh_update() argument
2272 struct ehci_hcd *ehci, in qtd_copy_status() argument
2455 ehci_dbg (ehci, "devpath %s ep%d%s 3strikes\n", in qtd_copy_status()
2467 ehci_vdbg (ehci, in qtd_copy_status()
2658 ehci_urb_done (struct ehci_hcd *ehci, struct urb *urb, struct pt_regs *regs) in ehci_urb_done() argument
2667 hcd_to_bus (&ehci->hcd)->bandwidth_int_reqs--; in ehci_urb_done()
2669 qh_put (ehci, qh); in ehci_urb_done()
2774 COUNT (ehci->stats.complete); in ehci_urb_done()
2779 COUNT (ehci->stats.complete); in ehci_urb_done()
2832 COUNT (ehci->stats.unlink); in ehci_urb_done()
2838 spin_unlock (&ehci->lock); in ehci_urb_done()
2842 usb_hcd_giveback_urb (&ehci->hcd, urb, regs); in ehci_urb_done()
2843 spin_lock (&ehci->lock); in ehci_urb_done()
2898 qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh, struct pt_regs *regs) in qh_completions() argument
3029 ehci_urb_done (ehci, last->urb, regs); in qh_completions()
3081 ehci_qtd_free (ehci, last); in qh_completions()
3150 == ehci->async->hw_alt_next) { in qh_completions()
3163 && HCD_IS_RUNNING (ehci->hcd.state))) { in qh_completions()
3290 qtd_copy_status (ehci, urb, qtd->length, token); in qh_completions()
3313 ehci_urb_done (ehci, last->urb, regs); in qh_completions()
3315 ehci_qtd_free (ehci, last); in qh_completions()
3381 qh_update (ehci, qh, end); in qh_completions()
3443 struct ehci_hcd *ehci, in qtd_list_free() argument
3503 ehci_qtd_free (ehci, qtd); in qtd_list_free()
3558 struct ehci_hcd *ehci, in qh_urb_transaction() argument
3665 qtd = ehci_qtd_alloc (ehci, flags); in qh_urb_transaction()
3781 qtd = ehci_qtd_alloc (ehci, flags); in qh_urb_transaction()
3925 qtd->hw_alt_next = ehci->async->hw_alt_next; in qh_urb_transaction()
3983 qtd = ehci_qtd_alloc (ehci, flags); in qh_urb_transaction()
4155 qtd = ehci_qtd_alloc (ehci, flags); in qh_urb_transaction()
4271 qtd_list_free (ehci, urb, head); in qh_urb_transaction()
4436 struct ehci_hcd *ehci, in qh_make() argument
4440 struct ehci_qh *qh = ehci_qh_alloc (ehci, flags); in qh_make()
4920 qh_put (ehci, qh); in qh_make()
4978 qh_update (ehci, qh, qh->dummy); in qh_make()
4987 static void qh_link_async (struct ehci_hcd *ehci, struct ehci_qh *qh) in qh_link_async() argument
5042 head = ehci->async; in qh_link_async()
5043 timer_action_done (ehci, TIMER_ASYNC_OFF); in qh_link_async()
5046 U32 cmd = ehci_readl ((U32)&ehci->regs->command); in qh_link_async()
5050 (void) handshake (&ehci->regs->status, STS_ASS, 0, 150); in qh_link_async()
5052 ehci_writel (cmd, (U32)&ehci->regs->command); in qh_link_async()
5053 ehci->hcd.state = USB_STATE_RUNNING; in qh_link_async()
5122 static void qh_link_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
5129 if (unlikely (!(q = ehci->async))) {
5130 U32 cmd = ehci_readl (&ehci->regs->command);
5133 while (ehci_readl (&ehci->regs->status) & STS_ASS)
5188 ehci->async = qh;
5189 ehci_writel ((U32)qh->qh_dma, &ehci->regs->async_next);
5191 ehci_writel (cmd, &ehci->regs->command);
5192 ehci->hcd.state = USB_STATE_RUNNING;
5261 struct ehci_hcd *ehci, in qh_append_tds() argument
5273 qh = qh_make (ehci, urb, SLAB_ATOMIC); in qh_append_tds()
5427 …ehci_warn (ehci, "clear toggle dev%d ep%d%s: not idle\n", usb_pipedevice (urb->pipe), epnum & 0x0f… in qh_append_tds()
5571 struct ehci_hcd *ehci, in submit_async() argument
5637 ehci_vdbg (ehci, "urb %p buf %p len %d ep%d%s qtd %p [qh %p]\n", in submit_async()
5690 spin_lock_irqsave (&ehci->lock, flags); in submit_async()
5691 qh = qh_append_tds (ehci, urb, qtd_list, epnum, &dev->ep [epnum]); in submit_async()
5698 qh_link_async (ehci, qh_get (qh)); in submit_async()
5705 spin_unlock_irqrestore (&ehci->lock, flags); in submit_async()
5707 qtd_list_free (ehci, urb, qtd_list); in submit_async()
5716 static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh);
5766 static void end_unlink_async (struct ehci_hcd *ehci, struct pt_regs *regs) in end_unlink_async() argument
5768 struct ehci_qh *qh = ehci->reclaim; in end_unlink_async()
5772 timer_action_done (ehci, TIMER_IAA_WATCHDOG); in end_unlink_async()
5777 qh_put (ehci, qh); // refcount from reclaim in end_unlink_async()
5781 ehci->reclaim = next; in end_unlink_async()
5782 ehci->reclaim_ready = 0; in end_unlink_async()
5833 qh_completions (ehci, qh, regs); in end_unlink_async()
5836 && HCD_IS_RUNNING (ehci->hcd.state)) in end_unlink_async()
5837 qh_link_async (ehci, qh); in end_unlink_async()
5839 qh_put (ehci, qh); // refcount from async list in end_unlink_async()
5841 if (HCD_IS_RUNNING (ehci->hcd.state) in end_unlink_async()
5842 && ehci->async->qh_next.qh == 0) in end_unlink_async()
5843 timer_action (ehci, TIMER_ASYNC_OFF); in end_unlink_async()
5847 ehci->reclaim = 0; in end_unlink_async()
5848 start_unlink_async (ehci, next); in end_unlink_async()
5901 static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh) in start_unlink_async() argument
5903 int cmd = ehci_readl ((U32)&ehci->regs->command); in start_unlink_async()
5907 if (ehci->reclaim in start_unlink_async()
5912 || !spin_is_locked (&ehci->lock) in start_unlink_async()
5967 if (unlikely (qh == ehci->async)) { in start_unlink_async()
5969 if (ehci->hcd.state != USB_STATE_HALT) { in start_unlink_async()
5970 ehci_writel (cmd & ~CMD_ASE, (U32)&ehci->regs->command); in start_unlink_async()
5974 timer_action_done (ehci, TIMER_ASYNC_OFF); in start_unlink_async()
5979 ehci->reclaim = qh = qh_get (qh); in start_unlink_async()
5981 prev = ehci->async; in start_unlink_async()
6037 if (unlikely (ehci->hcd.state == USB_STATE_HALT)) { in start_unlink_async()
6041 end_unlink_async (ehci, NULL); in start_unlink_async()
6045 ehci->reclaim_ready = 0; in start_unlink_async()
6047 if (!ehci->uDontSendIAA) in start_unlink_async()
6050 ehci_writel (cmd, (U32)&ehci->regs->command); in start_unlink_async()
6054 timer_action (ehci, TIMER_IAA_WATCHDOG); in start_unlink_async()
6108 scan_async (struct ehci_hcd *ehci, struct pt_regs *regs) in scan_async() argument
6161 if (!++(ehci->stamp)) in scan_async()
6162 ehci->stamp++; in scan_async()
6163 timer_action_done (ehci, TIMER_ASYNC_SHRINK); in scan_async()
6165 qh = ehci->async->qh_next.qh; in scan_async()
6170 && qh->stamp != ehci->stamp) { in scan_async()
6222 qh->stamp = ehci->stamp; in scan_async()
6223 temp = qh_completions (ehci, qh, regs); in scan_async()
6224 qh_put (ehci, qh); in scan_async()
6285 if (qh->stamp == ehci->stamp) in scan_async()
6287 else if (!ehci->reclaim in scan_async()
6289 start_unlink_async (ehci, qh); in scan_async()
6342 if (!ehci->reclaim && qh->qh_state == QH_STATE_LINKED) in scan_async()
6343 start_unlink_async (ehci, qh); in scan_async()
6350 timer_action (ehci, TIMER_ASYNC_SHRINK); in scan_async()
6360 static void ehci_work(struct ehci_hcd *ehci, struct pt_regs *regs);
6364 struct ehci_hcd *ehci = (struct ehci_hcd *) param; in ehci_watchdog() local
6372 kdbg("action: 0x%08X %s",(U32)ehci->actions,"\n"); in ehci_watchdog()
6373 spin_lock_irqsave (&ehci->lock, flags); in ehci_watchdog()
6424 if (ehci->reclaim) { in ehci_watchdog()
6425 U32 status = ehci_readl ((U32)&ehci->regs->status); in ehci_watchdog()
6428 ehci_vdbg (ehci, "lost IAA%s%s","\n",""); in ehci_watchdog()
6429 COUNT (ehci->stats.lost_iaa); in ehci_watchdog()
6430 ehci_writel (STS_IAA, (U32)&ehci->regs->status); in ehci_watchdog()
6431 ehci->reclaim_ready = 1; in ehci_watchdog()
6482 else if ( (ehci_readl((U32)&ehci->regs->command)&CMD_IAAD) && !(status & STS_IAA)) in ehci_watchdog()
6485 ehci->reclaim_ready = 1; in ehci_watchdog()
6491 if (test_bit (TIMER_ASYNC_OFF, &ehci->actions)) in ehci_watchdog()
6492 start_unlink_async (ehci, ehci->async); in ehci_watchdog()
6495 ehci_work (ehci, NULL); in ehci_watchdog()
6497 spin_unlock_irqrestore (&ehci->lock, flags); in ehci_watchdog()
6514 static int bios_handoff (struct ehci_hcd *ehci, int where, U32 cap) in bios_handoff() argument
6576 pci_read_config_dword (ehci->hcd.pdev, where, &cap); in bios_handoff()
6628 ehci_err (ehci, "BIOS handoff failed (%d, %04x)%s%s",0, in bios_handoff()
6632 ehci_dbg (ehci, "BIOS handoff succeeded%s",""); in bios_handoff()
6639 struct ehci_hcd *ehci; in ehci_reboot() local
6641 ehci = container_of (self, struct ehci_hcd, reboot_notifier); in ehci_reboot()
6702 struct ehci_hcd *ehci = hcd_to_ehci (hcd); in ehci_hc_reset() local
6705 spin_lock_init (&ehci->lock); in ehci_hc_reset()
6707 ehci->caps = (struct ehci_caps *) hcd->regs; in ehci_hc_reset()
6708 ehci->regs = (struct ehci_regs *) ( (U32)hcd->regs + in ehci_hc_reset()
6709 (U32)ehci_readb ((U32)&ehci->caps->length)); in ehci_hc_reset()
6710 dbg_hcs_params (ehci, "reset"); in ehci_hc_reset()
6711 dbg_hcc_params (ehci, "reset"); in ehci_hc_reset()
6762 temp = HCC_EXT_CAPS (ehci_readl ((U32)&ehci->caps->hcc_params)); in ehci_hc_reset()
6766 pci_read_config_dword (ehci->hcd.pdev, temp, &cap); in ehci_hc_reset()
6768 ehci_dbg (ehci, "capability %04x at %02x\n", cap, temp); in ehci_hc_reset()
6777 ehci_warn (ehci, "illegal capability!%s","\n"); in ehci_hc_reset()
6836 ehci->hcs_params = ehci_readl ((U32)&ehci->caps->hcs_params); in ehci_hc_reset()
6839 return ehci_halt (ehci); in ehci_hc_reset()
6846 struct ehci_hcd *ehci = hcd_to_ehci (hcd); in ehci_start() local
6903 ehci->periodic_size = DEFAULT_I_TDPS; in ehci_start()
6904 if ((retval = ehci_mem_init (ehci, SLAB_KERNEL)) < 0) in ehci_start()
6908 hcc_params = ehci_readl ((U32)&ehci->caps->hcc_params); in ehci_start()
6910 ehci->i_thresh = 8; in ehci_start()
6912 ehci->i_thresh = 2 + HCC_ISOC_THRES (hcc_params); in ehci_start()
6914 ehci->reclaim = 0; in ehci_start()
6915 ehci->next_uframe = -1; in ehci_start()
6973 if ((retval = ehci_reset (ehci)) != 0) { in ehci_start()
6974 ehci_mem_cleanup (ehci); in ehci_start()
6978 ehci_writel (INTR_MASK, (U32)&ehci->regs->intr_enable); in ehci_start()
6979 temp=ehci_readl((U32)&ehci->regs->bus_control); in ehci_start()
6983 ehci_writel(temp,(U32)&ehci->regs->bus_control); //set intr high active in ehci_start()
6984 ehci_writel (ehci->periodic_dma, (U32)&ehci->regs->frame_list); in ehci_start()
6986 ehci->async->qh_next.qh = 0; in ehci_start()
7036 ehci->async->hw_next = QH_NEXT (ehci->async->qh_dma); in ehci_start()
7037 ehci->async->hw_info1 = CPUToLE32(QH_HEAD); in ehci_start()
7038 ehci->async->hw_token = CPUToLE32(QTD_STS_HALT); in ehci_start()
7088 ehci->async->hw_qtd_next = EHCI_LIST_END; in ehci_start()
7089 ehci->async->qh_state = QH_STATE_LINKED; in ehci_start()
7090 ehci->async->hw_alt_next = QTD_NEXT (ehci->async->dummy->qtd_dma); in ehci_start()
7091 diag_printf("qh: %p\n", (U32)ehci->async->qh_dma); in ehci_start()
7092 ehci_writel ((U32)ehci->async->qh_dma, (U32)&ehci->regs->async_next); in ehci_start()
7096 ehci_writel (0, (U32)&ehci->regs->segment); in ehci_start()
7148 if (!pci_set_dma_mask (ehci->hcd.pdev, 0xffffffffffffffffULL)) in ehci_start()
7149 ehci_info (ehci, "enabled 64bit PCI DMA\n"); in ehci_start()
7155 pci_set_mwi (ehci->hcd.pdev); in ehci_start()
7159 temp = ehci_readl ((U32)&ehci->regs->command) & 0x0fff; in ehci_start()
7234 case 0: ehci->periodic_size = 1024; break; in ehci_start()
7235 case 1: ehci->periodic_size = 512; break; in ehci_start()
7236 case 2: ehci->periodic_size = 256; break; in ehci_start()
7248 ehci_writel (temp, (U32)&ehci->regs->command); in ehci_start()
7249 dbg_cmd (ehci, "init", temp); in ehci_start()
7254 init_timer (&ehci->watchdog); in ehci_start()
7255 ehci->watchdog.function = ehci_watchdog; in ehci_start()
7256 ehci->watchdog.data = (U32) ehci; in ehci_start()
7263 ehci_mem_cleanup (ehci); in ehci_start()
7316 ehci->hcd.state = USB_STATE_RUNNING; in ehci_start()
7320 temp = ehci_readl ((U32)&ehci->regs->command); /* unblock posted write */ in ehci_start()
7377 temp = ehci_readw ((U32)&ehci->caps->hci_version); in ehci_start()
7378 ehci_info (ehci, in ehci_start()
7435 ehci_ready (ehci); in ehci_start()
7436 ehci_reset (ehci); in ehci_start()
7506 struct ehci_hcd *ehci = hcd_to_ehci (hcd); in ehci_stop() local
7508 ehci_dbg (ehci, "stop%s",""); in ehci_stop()
7512 ehci_ready (ehci); in ehci_stop()
7519 del_timer_sync (&ehci->watchdog); in ehci_stop()
7520 ehci_reset (ehci); in ehci_stop()
7579 spin_lock_irq (&ehci->lock); in ehci_stop()
7580 ehci_work (ehci, NULL); in ehci_stop()
7581 spin_unlock_irq (&ehci->lock); in ehci_stop()
7582 ehci_mem_cleanup (ehci); in ehci_stop()
7585 ehci_dbg (ehci, "irq normal %ld err %ld reclaim %ld (lost %ld)\n", in ehci_stop()
7586 ehci->stats.normal, ehci->stats.error, ehci->stats.reclaim, in ehci_stop()
7587 ehci->stats.lost_iaa); in ehci_stop()
7588 ehci_dbg (ehci, "complete %ld unlink %ld\n", in ehci_stop()
7589 ehci->stats.complete, ehci->stats.unlink); in ehci_stop()
7592 dbg_status (ehci, "ehci_stop completed", ehci_readl ((U32)&ehci->regs->status)); in ehci_stop()
7597 struct ehci_hcd *ehci = hcd_to_ehci (hcd); in ehci_get_frame() local
7647 return (ehci_readl ((U32)&ehci->regs->frame_index) >> 3) % ehci->periodic_size; in ehci_get_frame()
7654 struct ehci_hcd *ehci = hcd_to_ehci (hcd); in ehci_suspend() local
7658 ehci_dbg (ehci, "suspend to %d\n", state); in ehci_suspend()
7660 ports = HCS_N_PORTS (ehci->hcs_params); in ehci_suspend()
7663 ehci_ready (ehci); in ehci_suspend()
7714 ehci_writel(ehci_readl ((U32)&ehci->regs->command) & ~CMD_RUN, (U32)&ehci->regs->command); in ehci_suspend()
7715 while((ehci_readl((U32)&ehci->regs->status)&STS_HALT) == 0); in ehci_suspend()
7719 int temp = ehci_readl ((U32)&ehci->regs->port_status [i]); in ehci_suspend()
7728 ehci_dbg (ehci, "suspend port %d", i); in ehci_suspend()
7730 ehci_writel (temp, (U32)&ehci->regs->port_status [i]); in ehci_suspend()
7737 struct ehci_hcd *ehci = hcd_to_ehci (hcd); in ehci_resume() local
7742 ehci_dbg (ehci, "resume%s",""); in ehci_resume()
7744 ports = HCS_N_PORTS (ehci->hcs_params); in ehci_resume()
7800 int temp = ehci_readl ((U32)&ehci->regs->port_status [i]); in ehci_resume()
7804 ehci_dbg (ehci, "resume port %d", i); in ehci_resume()
7806 ehci_writel (temp, (U32)&ehci->regs->port_status [i]); in ehci_resume()
7807 tmp = ehci_readl ((U32)&ehci->regs->command); /* unblock posted writes */ in ehci_resume()
7810 ehci_writel (temp, (U32)&ehci->regs->port_status [i]); in ehci_resume()
7812 tmp = ehci_readl ((U32)&ehci->regs->command); /* unblock posted writes */ in ehci_resume()
7819 static void ehci_work (struct ehci_hcd *ehci, struct pt_regs *regs) in ehci_work() argument
7822 timer_action_done (ehci, TIMER_IO_WATCHDOG); in ehci_work()
7826 if (ehci->reclaim_ready) in ehci_work()
7827 end_unlink_async (ehci, regs); in ehci_work()
7828 scan_async (ehci, regs); in ehci_work()
7830 if (ehci->reclaim_ready) in ehci_work()
7882 scan_async (ehci, regs); in ehci_work()
7883 end_unlink_async (ehci, regs); in ehci_work()
7886 if (ehci->next_uframe != -1) in ehci_work()
7887 scan_periodic (ehci, regs); in ehci_work()
7892 if ((ehci->async->qh_next.ptr != 0) || (ehci->periodic_sched != 0)) in ehci_work()
7893 timer_action (ehci, TIMER_IO_WATCHDOG); in ehci_work()
7900 struct ehci_hcd *ehci= hcd_to_ehci (hcd); in ehci_irq() local
7908 spin_lock (&ehci->lock); in ehci_irq()
7910 status = ehci_readl ((U32)&ehci->regs->status); in ehci_irq()
7915 ehci_dbg (ehci, "device removed%s%s","\n",""); in ehci_irq()
7973 ehci_writel (status, (U32)&ehci->regs->status); in ehci_irq()
7974 cmd_t = ehci_readl ((U32)&ehci->regs->command); /* unblock posted write */ in ehci_irq()
7976 ehci->uDontSendIAA = 0; in ehci_irq()
7981 dbg_status (ehci, "irq", status); in ehci_irq()
7991 ehci->reclaim_ready = 0; in ehci_irq()
7992 int cmd = ehci_readl ((U32)&ehci->regs->command); in ehci_irq()
7994 ehci_writel (cmd, (U32)&ehci->regs->command); in ehci_irq()
7995 (void) ehci_readl ((U32)&ehci->regs->command); in ehci_irq()
7996 ehci->uDontSendIAA = 1; in ehci_irq()
8053 COUNT (ehci->stats.normal); in ehci_irq()
8058 COUNT (ehci->stats.error); in ehci_irq()
8066 COUNT (ehci->stats.reclaim); in ehci_irq()
8067 ehci->reclaim_ready = 1; in ehci_irq()
8068 ehci->uDontSendIAA = 1; in ehci_irq()
8077 unsigned i = HCS_N_PORTS (ehci->hcs_params); in ehci_irq()
8139 int pstatus = ehci_readl((U32)&ehci->regs->port_status [i]); in ehci_irq()
8147 ehci->reset_done[i] == 0)) in ehci_irq()
8158 ehci->reset_done [i] = jiffies + ((20 /* msec */ * HZ) / 1000); in ehci_irq()
8159 ehci_dbg (ehci, "port %d remote wakeup\n", i + 1); in ehci_irq()
8160 mod_timer(&hcd->rh_timer, ehci->reset_done[i], 0); in ehci_irq()
8216 ehci_err (ehci, "fatal error%s","\n"); in ehci_irq()
8218 ehci_reset (ehci); in ehci_irq()
8226 …(ehci->periodic_sched != 0) //If we has periodic transactions in Schedule, we must scan periodic w… in ehci_irq()
8228 ehci_work (ehci, regs); in ehci_irq()
8230 spin_unlock (&ehci->lock); in ehci_irq()
8293 struct ehci_hcd *ehci = hcd_to_ehci (hcd); in ehci_urb_enqueue() local
8304 if( (ehci_readl ((U32)&ehci->regs->port_status[0])&PORT_CONNECT) == 0 ) in ehci_urb_enqueue()
8369 if (!qh_urb_transaction (ehci, urb, &urb->qtd_list, mem_flags)) in ehci_urb_enqueue()
8376 return submit_async (ehci, urb, &urb->qtd_list, mem_flags); in ehci_urb_enqueue()
8380 if (!qh_urb_transaction (ehci, urb, &qtd_list, mem_flags)) in ehci_urb_enqueue()
8382 return submit_async (ehci, urb, &qtd_list, mem_flags); in ehci_urb_enqueue()
8386 if (!qh_urb_transaction (ehci, urb, &qtd_list, mem_flags)) in ehci_urb_enqueue()
8388 return intr_submit (ehci, urb, &qtd_list, mem_flags); in ehci_urb_enqueue()
8393 return itd_submit (ehci, urb, mem_flags); in ehci_urb_enqueue()
8397 return sitd_submit (ehci, urb, mem_flags); in ehci_urb_enqueue()
8405 extern void ResetMstarUsb(struct ehci_hcd *ehci);
8408 struct ehci_hcd *ehci = hcd_to_ehci(pUsbHcd); in USB_HW_Reset() local
8409 ResetMstarUsb(ehci); in USB_HW_Reset()
8410 ehci_StopRun_Setting(HOST20_Enable, ehci); in USB_HW_Reset()
8419 struct ehci_hcd *ehci = hcd_to_ehci (hcd); in ehci_urb_dequeue() local
8426 spin_lock_irqsave (&ehci->lock, flags); in ehci_urb_dequeue()
8486 && ehci->reclaim in ehci_urb_dequeue()
8487 && HCD_IS_RUNNING (ehci->hcd.state) in ehci_urb_dequeue()
8491 for (last = ehci->reclaim; in ehci_urb_dequeue()
8498 } else if (!HCD_IS_RUNNING (ehci->hcd.state) && ehci->reclaim) in ehci_urb_dequeue()
8499 end_unlink_async (ehci, NULL); in ehci_urb_dequeue()
8551 start_unlink_async (ehci, qh); in ehci_urb_dequeue()
8555 if( (ehci_readl ((U32)&ehci->regs->port_status[0])&PORT_CONNECT) == 0 ) in ehci_urb_dequeue()
8565 end_unlink_async (ehci, NULL); in ehci_urb_dequeue()
8567 hub_port_disable(ehci->hcd.self.root_hub,0); in ehci_urb_dequeue()
8569 else if ( (ehci_readl ((U32)&ehci->regs->command)&CMD_RUN) == 0 ) in ehci_urb_dequeue()
8629 end_unlink_async (ehci, NULL); in ehci_urb_dequeue()
8631 hub_port_disable(ehci->hcd.self.root_hub,0); in ehci_urb_dequeue()
8690 intr_deschedule (ehci, qh, 1); in ehci_urb_dequeue()
8693 qh_completions (ehci, qh, NULL); in ehci_urb_dequeue()
8746 && HCD_IS_RUNNING (ehci->hcd.state)) { in ehci_urb_dequeue()
8749 status = qh_schedule (ehci, qh); in ehci_urb_dequeue()
8750 spin_unlock_irqrestore (&ehci->lock, flags); in ehci_urb_dequeue()
8866 spin_unlock_irqrestore (&ehci->lock, flags); in ehci_urb_dequeue()
8925 struct ehci_hcd *ehci = hcd_to_ehci (hcd); in ehci_endpoint_disable() local
8986 spin_lock_irqsave (&ehci->lock, flags); in ehci_endpoint_disable()
8991 if (!HCD_IS_RUNNING (ehci->hcd.state)) in ehci_endpoint_disable()
9044 spin_unlock_irqrestore (&ehci->lock, flags); in ehci_endpoint_disable()
9050 qh_put (ehci, qh); in ehci_endpoint_disable()
9109 ehci_err (ehci, "qh %p (#%d) state %d%s\n", in ehci_endpoint_disable()
9117 spin_unlock_irqrestore (&ehci->lock, flags); in ehci_endpoint_disable()
9611 void ehci_StopRun_Setting(MS_U8 bOption, struct ehci_hcd *ehci) in ehci_StopRun_Setting() argument
9617 temp = ehci_readl((U32)&ehci->regs->command); in ehci_StopRun_Setting()
9622 ehci_writel(temp, (U32)&ehci->regs->command); in ehci_StopRun_Setting()
9624 temp = ehci_readl((U32)&ehci->regs->command); in ehci_StopRun_Setting()
9629 temp = ehci_readl((U32)&ehci->regs->command); in ehci_StopRun_Setting()
9634 ehci_writel(temp, (U32)&ehci->regs->command); in ehci_StopRun_Setting()
9636 temp = ehci_readl((U32)&ehci->regs->command); in ehci_StopRun_Setting()
9852 struct ehci_hcd *ehci, in qh_urb_transaction_EHSET() argument
9912 qtd = ehci_qtd_alloc (ehci, flags); in qh_urb_transaction_EHSET()
10065 qtd->hw_alt_next = ehci->async->hw_alt_next; in qh_urb_transaction_EHSET()
10170 qtd = ehci_qtd_alloc (ehci, flags); in qh_urb_transaction_EHSET()
10244 qtd = ehci_qtd_alloc (ehci, flags); in qh_urb_transaction_EHSET()
10310 qtd_list_free (ehci, urb, head); in qh_urb_transaction_EHSET()
10315 struct ehci_hcd *ehci, in submit_async_EHSET() argument
10320 return submit_async(ehci, urb, qtd_list, mem_flags); in submit_async_EHSET()