• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/drivers/usb/host/

Lines Matching defs:ehci

140 #include "ehci.h"
141 #include "ehci-dbg.c"
162 static int handshake (struct ehci_hcd *ehci, void __iomem *ptr,
168 result = ehci_readl(ehci, ptr);
181 static int ehci_halt (struct ehci_hcd *ehci)
183 u32 temp = ehci_readl(ehci, &ehci->regs->status);
186 ehci_writel(ehci, 0, &ehci->regs->intr_enable);
191 temp = ehci_readl(ehci, &ehci->regs->command);
193 ehci_writel(ehci, temp, &ehci->regs->command);
194 return handshake (ehci, &ehci->regs->status,
199 static void tdi_reset (struct ehci_hcd *ehci)
204 reg_ptr = (u32 __iomem *)(((u8 __iomem *)ehci->regs) + 0x68);
205 tmp = ehci_readl(ehci, reg_ptr);
207 ehci_writel(ehci, tmp, reg_ptr);
211 static int ehci_reset (struct ehci_hcd *ehci)
214 u32 command = ehci_readl(ehci, &ehci->regs->command);
217 dbg_cmd (ehci, "reset", command);
218 ehci_writel(ehci, command, &ehci->regs->command);
219 ehci_to_hcd(ehci)->state = HC_STATE_HALT;
220 ehci->next_statechange = jiffies;
221 retval = handshake (ehci, &ehci->regs->command,
227 if (ehci_is_TDI(ehci))
228 tdi_reset (ehci);
233 static int ehci_optimized(struct ehci_hcd *ehci, struct ehci_qh *qh)
237 if (ehci->ehci_pipes[p] == qh)
243 static void ehci_quiesce (struct ehci_hcd *ehci)
248 if (!HC_IS_RUNNING (ehci_to_hcd(ehci)->state))
253 temp = ehci_readl(ehci, &ehci->regs->command) << 10;
255 if (handshake (ehci, &ehci->regs->status, STS_ASS | STS_PSS,
257 ehci_to_hcd(ehci)->state = HC_STATE_HALT;
262 temp = ehci_readl(ehci, &ehci->regs->command);
264 ehci_writel(ehci, temp, &ehci->regs->command);
267 if (handshake (ehci, &ehci->regs->status, STS_ASS | STS_PSS,
269 ehci_to_hcd(ehci)->state = HC_STATE_HALT;
276 static void ehci_work(struct ehci_hcd *ehci);
278 #include "ehci-hub.c"
279 #include "ehci-mem.c"
280 #include "ehci-q.c"
281 #include "ehci-sched.c"
329 struct ehci_hcd *ehci = (struct ehci_hcd *)(qtdc->ehci);
339 spin_lock_irqsave (&ehci->lock, flags);
385 qh = qh_append_tds (ehci, urb, &qtdc->cache, epnum, &ep->hcpriv);
391 qh_link_async (ehci, qh_get (qh));
398 spin_unlock_irqrestore (&ehci->lock, flags);
402 ehci_qtdc_t *ehci_qtdc_init(struct ehci_hcd *ehci, int vid, int pid, int num, int ep, int size, int timeout, unsigned int msglevel)
407 ehci_err (ehci, "pid %x vid %x not valid\n", pid, vid);
412 ehci_err (ehci, "qtdc %d exceeding limit %d\n", num, NUM_QTD_CACHE);
417 ehci_err (ehci, "qtdc %d disabled: invalid ep 0x%x\n", num, ep);
422 ehci_err (ehci, "qtdc %d disabled: invalid size %d\n", num, size);
427 ehci_err (ehci, "qtdc %d disabled: invalid timeout %d\n", num, timeout);
433 ehci_err (ehci, "qtdc %d disabled: alloc failed\n", num);
439 ehci->qtdc_vid = vid;
440 ehci->qtdc_pid = pid;
441 qtdc->ehci = (void*)ehci;
456 ehci_info (ehci, "qtdc %d enabled: vid %x pid %x ep 0x%x size %d timeout %d\n",
472 struct ehci_hcd *ehci = (struct ehci_hcd *) param;
475 spin_lock_irqsave (&ehci->lock, flags);
478 if (ehci->reclaim) {
479 u32 status = ehci_readl(ehci, &ehci->regs->status);
481 ehci_vdbg (ehci, "lost IAA\n");
482 COUNT (ehci->stats.lost_iaa);
483 ehci_writel(ehci, STS_IAA, &ehci->regs->status);
484 ehci->reclaim_ready = 1;
489 if (test_bit (TIMER_ASYNC_OFF, &ehci->actions))
490 start_unlink_async (ehci, ehci->async);
492 /* ehci could run by timer, without IRQs ... */
493 ehci_work (ehci);
495 spin_unlock_irqrestore (&ehci->lock, flags);
502 static void ehci_turn_off_all_ports(struct ehci_hcd *ehci)
504 int port = HCS_N_PORTS(ehci->hcs_params);
507 ehci_writel(ehci, PORT_RWC_BITS,
508 &ehci->regs->port_status[port]);
518 struct ehci_hcd *ehci;
520 ehci = hcd_to_ehci (hcd);
521 (void) ehci_halt (ehci);
522 ehci_turn_off_all_ports(ehci);
525 ehci_writel(ehci, 0, &ehci->regs->configured_flag);
528 ehci_readl(ehci, &ehci->regs->configured_flag);
531 static void ehci_port_power (struct ehci_hcd *ehci, int is_on)
535 if (!HCS_PPC (ehci->hcs_params))
538 ehci_dbg (ehci, "...power%s ports...\n", is_on ? "up" : "down");
539 for (port = HCS_N_PORTS (ehci->hcs_params); port > 0; )
540 (void) ehci_hub_control(ehci_to_hcd(ehci),
551 * it calls driver completion functions, after dropping ehci->lock.
553 static void ehci_work (struct ehci_hcd *ehci)
555 timer_action_done (ehci, TIMER_IO_WATCHDOG);
556 if (ehci->reclaim_ready)
557 end_unlink_async (ehci);
559 /* another CPU may drop ehci->lock during a schedule scan while
563 if (ehci->scanning)
565 ehci->scanning = 1;
566 scan_async (ehci);
567 if (ehci->next_uframe != -1)
568 scan_periodic (ehci);
569 ehci->scanning = 0;
575 if (HC_IS_RUNNING (ehci_to_hcd(ehci)->state) &&
576 (ehci->async->qh_next.ptr != NULL ||
577 ehci->periodic_sched != 0))
578 timer_action (ehci, TIMER_IO_WATCHDOG);
583 struct ehci_hcd *ehci = hcd_to_ehci (hcd);
585 ehci_dbg (ehci, "stop\n");
588 ehci_port_power (ehci, 0);
591 del_timer_sync (&ehci->watchdog);
593 del_timer_sync (&ehci->qtdc_watchdog);
594 ehci_qtdc_deinit (ehci->qtdc[0]);
595 ehci_qtdc_deinit (ehci->qtdc[1]);
598 spin_lock_irq(&ehci->lock);
600 ehci_quiesce (ehci);
602 ehci_reset (ehci);
603 ehci_writel(ehci, 0, &ehci->regs->intr_enable);
604 spin_unlock_irq(&ehci->lock);
607 ehci_writel(ehci, 0, &ehci->regs->configured_flag);
609 remove_companion_file(ehci);
610 remove_debug_files (ehci);
613 spin_lock_irq (&ehci->lock);
614 if (ehci->async)
615 ehci_work (ehci);
616 spin_unlock_irq (&ehci->lock);
617 ehci_mem_cleanup (ehci);
620 ehci_dbg (ehci, "irq normal %ld err %ld reclaim %ld (lost %ld)\n",
621 ehci->stats.normal, ehci->stats.error, ehci->stats.reclaim,
622 ehci->stats.lost_iaa);
623 ehci_dbg (ehci, "complete %ld unlink %ld\n",
624 ehci->stats.complete, ehci->stats.unlink);
627 dbg_status (ehci, "ehci_stop completed",
628 ehci_readl(ehci, &ehci->regs->status));
634 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
639 ehci_info(ehci, "EHCI Fastpath: New EHCI driver starting\n");
641 spin_lock_init(&ehci->lock);
643 init_timer(&ehci->watchdog);
644 ehci->watchdog.function = ehci_watchdog;
645 ehci->watchdog.data = (unsigned long) ehci;
648 ehci->qtdc[0] = ehci_qtdc_init(ehci, qtdc_vid, qtdc_pid, 0, qtdc0_ep, qtdc0_sz, qtdc0_to, qtdc0_ml);
649 ehci->qtdc[1] = ehci_qtdc_init(ehci, qtdc_vid, qtdc_pid, 1, qtdc1_ep, qtdc1_sz, qtdc1_to, qtdc1_ml);
656 ehci->periodic_size = DEFAULT_I_TDPS;
657 if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0)
661 hcc_params = ehci_readl(ehci, &ehci->caps->hcc_params);
663 ehci->i_thresh = 8;
665 ehci->i_thresh = 2 + HCC_ISOC_THRES(hcc_params);
667 ehci->reclaim = NULL;
668 ehci->reclaim_ready = 0;
669 ehci->next_uframe = -1;
678 ehci->async->qh_next.qh = NULL;
679 ehci->async->hw_next = QH_NEXT(ehci->async->qh_dma);
680 ehci->async->hw_info1 = cpu_to_le32(QH_HEAD);
681 ehci->async->hw_token = cpu_to_le32(QTD_STS_HALT);
682 ehci->async->hw_qtd_next = EHCI_LIST_END;
683 ehci->async->qh_state = QH_STATE_LINKED;
684 ehci->async->hw_alt_next = QTD_NEXT(ehci->async->dummy->qtd_dma);
703 ehci_dbg(ehci, "park %d\n", park);
710 case 0: ehci->periodic_size = 1024; break;
711 case 1: ehci->periodic_size = 512; break;
712 case 2: ehci->periodic_size = 256; break;
716 ehci->command = temp;
719 ehci->bypass_device = NULL;
720 ehci->ehci_pipes[0] = ehci->ehci_pipes[1] = ehci->ehci_pipes[2] = NULL;
721 ehci->ehci_bypass_callback = NULL;
729 struct ehci_hcd *ehci = hcd_to_ehci (hcd);
738 if ((retval = ehci_reset(ehci)) != 0) {
739 ehci_mem_cleanup(ehci);
742 ehci_writel(ehci, ehci->periodic_dma, &ehci->regs->frame_list);
743 ehci_writel(ehci, (u32)ehci->async->qh_dma, &ehci->regs->async_next);
746 * hcc_params controls whether ehci->regs->segment must (!!!)
757 hcc_params = ehci_readl(ehci, &ehci->caps->hcc_params);
759 ehci_writel(ehci, 0, &ehci->regs->segment);
765 ehci->command &= ~(CMD_LRESET|CMD_IAAD|CMD_PSE|CMD_ASE|CMD_RESET);
766 ehci->command |= CMD_RUN;
767 ehci_writel(ehci, ehci->command, &ehci->regs->command);
768 dbg_cmd (ehci, "init", ehci->command);
777 ehci_writel(ehci, FLAG_CF, &ehci->regs->configured_flag);
778 ehci_readl(ehci, &ehci->regs->command); /* unblock posted writes */
780 temp = HC_VERSION(ehci_readl(ehci, &ehci->caps->hc_capbase));
781 ehci_info (ehci,
783 ((ehci->sbrn & 0xf0)>>4), (ehci->sbrn & 0x0f),
787 ehci_writel(ehci, INTR_MASK,
788 &ehci->regs->intr_enable); /* Turn On Interrupts */
794 create_debug_files(ehci);
795 create_companion_file(ehci);
804 struct ehci_hcd *ehci = hcd_to_ehci (hcd);
808 spin_lock (&ehci->lock);
810 status = ehci_readl(ehci, &ehci->regs->status);
814 ehci_dbg (ehci, "device removed\n");
820 spin_unlock(&ehci->lock);
825 ehci_writel(ehci, status, &ehci->regs->status);
826 ehci_readl(ehci, &ehci->regs->command); /* unblock posted write */
831 dbg_status (ehci, "irq", status);
839 COUNT (ehci->stats.normal);
841 COUNT (ehci->stats.error);
847 COUNT (ehci->stats.reclaim);
848 ehci->reclaim_ready = 1;
854 unsigned i = HCS_N_PORTS (ehci->hcs_params);
858 if (!(ehci_readl(ehci, &ehci->regs->command) & CMD_RUN))
862 int pstatus = ehci_readl(ehci,
863 &ehci->regs->port_status [i]);
868 || ehci->reset_done [i] != 0)
875 ehci->reset_done [i] = jiffies + msecs_to_jiffies (20);
876 ehci_dbg (ehci, "port %d remote wakeup\n", i + 1);
877 mod_timer(&hcd->rh_timer, ehci->reset_done[i]);
884 status = ehci_readl(ehci, &ehci->regs->status);
885 dbg_cmd (ehci, "fatal", ehci_readl(ehci,
886 &ehci->regs->command));
887 dbg_status (ehci, "fatal", status);
889 ehci_err (ehci, "fatal error\n");
891 ehci_reset (ehci);
892 ehci_writel(ehci, 0, &ehci->regs->configured_flag);
901 ehci_work (ehci);
902 spin_unlock (&ehci->lock);
928 struct ehci_hcd *ehci = hcd_to_ehci (hcd);
937 if (!qh_urb_transaction (ehci, urb, &qtd_list, mem_flags))
939 return submit_async (ehci, ep, urb, &qtd_list, mem_flags);
942 if (!qh_urb_transaction (ehci, urb, &qtd_list, mem_flags))
944 return intr_submit (ehci, ep, urb, &qtd_list, mem_flags);
948 return itd_submit (ehci, urb, mem_flags);
950 return sitd_submit (ehci, urb, mem_flags);
954 static void unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
958 && ehci->reclaim
959 && HC_IS_RUNNING (ehci_to_hcd(ehci)->state)) {
962 for (last = ehci->reclaim;
970 } else if (!HC_IS_RUNNING (ehci_to_hcd(ehci)->state) && ehci->reclaim)
971 end_unlink_async (ehci);
975 start_unlink_async (ehci, qh);
984 struct ehci_hcd *ehci = hcd_to_ehci (hcd);
988 spin_lock_irqsave (&ehci->lock, flags);
995 if (ehci_qtdc_unlink(ehci, urb, NULL))
1004 unlink_async (ehci, qh);
1013 intr_deschedule (ehci, qh);
1016 qh_completions (ehci, qh);
1019 ehci_dbg (ehci, "bogus qh %p state %d\n",
1029 status = qh_schedule (ehci, qh);
1030 spin_unlock_irqrestore (&ehci->lock, flags);
1049 spin_unlock_irqrestore (&ehci->lock, flags);
1060 struct ehci_hcd *ehci = hcd_to_ehci (hcd);
1068 spin_lock_irqsave (&ehci->lock, flags);
1077 ehci_vdbg (ehci, "iso delay\n");
1085 for (tmp = ehci->async->qh_next.qh;
1092 unlink_async (ehci, qh);
1096 spin_unlock_irqrestore (&ehci->lock, flags);
1110 ehci_err (ehci, "qh %p (#%02x) state %d%s\n",
1117 spin_unlock_irqrestore (&ehci->lock, flags);
1123 struct ehci_hcd *ehci = hcd_to_ehci (hcd);
1124 return (ehci_readl(ehci, &ehci->regs->frame_index) >> 3) %
1125 ehci->periodic_size;
1137 #include "ehci-pci.c"
1142 #include "ehci-fsl.c"
1147 #include "ehci-au1xxx.c"
1152 #include "ehci-ps3.c"
1158 #error "missing bus glue for ehci-hcd"