• 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

19 /* this file is part of ehci-hcd.c */
20 static void qh_link_async (struct ehci_hcd *ehci, struct ehci_qh *qh);
21 static struct ehci_qh *qh_make (struct ehci_hcd *ehci, struct urb *urb, gfp_t flags);
23 static inline void ehci_qtd_free (struct ehci_hcd *ehci, struct ehci_qtd *qtd);
39 struct ehci_hcd *ehci = hcd_to_ehci (hcd);
43 ehci_dbg(ehci, "suspend root hub\n");
45 if (time_before (jiffies, ehci->next_statechange))
48 port = HCS_N_PORTS (ehci->hcs_params);
49 spin_lock_irq (&ehci->lock);
53 ehci_quiesce (ehci);
56 ehci->command = ehci_readl(ehci, &ehci->regs->command);
57 if (ehci->reclaim)
58 ehci->reclaim_ready = 1;
59 ehci_work(ehci);
66 ehci->bus_suspended = 0;
68 u32 __iomem *reg = &ehci->regs->port_status [port];
69 u32 t1 = ehci_readl(ehci, reg) & ~PORT_RWC_BITS;
76 set_bit(port, &ehci->bus_suspended);
86 ehci_vdbg (ehci, "port %d, %08x -> %08x\n",
88 ehci_writel(ehci, t2, reg);
93 del_timer_sync (&ehci->watchdog);
94 ehci_halt (ehci);
101 ehci_writel(ehci, mask, &ehci->regs->intr_enable);
102 ehci_readl(ehci, &ehci->regs->intr_enable);
104 ehci->next_statechange = jiffies + msecs_to_jiffies(10);
105 spin_unlock_irq (&ehci->lock);
113 struct ehci_hcd *ehci = hcd_to_ehci (hcd);
117 if (time_before (jiffies, ehci->next_statechange))
119 spin_lock_irq (&ehci->lock);
127 temp = ehci_readl(ehci, &ehci->regs->intr_enable);
128 ehci_dbg(ehci, "resume root hub%s\n", temp ? "" : " after power loss");
133 ehci_writel(ehci, 0, &ehci->regs->intr_enable);
136 ehci_writel(ehci, 0, &ehci->regs->segment);
137 ehci_writel(ehci, ehci->periodic_dma, &ehci->regs->frame_list);
138 ehci_writel(ehci, (u32) ehci->async->qh_dma, &ehci->regs->async_next);
141 ehci_writel(ehci, ehci->command, &ehci->regs->command);
148 i = HCS_N_PORTS (ehci->hcs_params);
150 temp = ehci_readl(ehci, &ehci->regs->port_status [i]);
153 if (test_bit(i, &ehci->bus_suspended) &&
155 ehci->reset_done [i] = jiffies + msecs_to_jiffies (20);
158 ehci_writel(ehci, temp, &ehci->regs->port_status [i]);
160 i = HCS_N_PORTS (ehci->hcs_params);
163 temp = ehci_readl(ehci, &ehci->regs->port_status [i]);
164 if (test_bit(i, &ehci->bus_suspended) &&
167 ehci_writel(ehci, temp, &ehci->regs->port_status [i]);
168 ehci_vdbg (ehci, "resumed port %d\n", i + 1);
171 (void) ehci_readl(ehci, &ehci->regs->command);
175 if (ehci->async->qh_next.qh)
177 if (ehci->periodic_sched)
180 ehci->command |= temp;
181 ehci_writel(ehci, ehci->command, &ehci->regs->command);
184 ehci->next_statechange = jiffies + msecs_to_jiffies(5);
188 ehci_writel(ehci, INTR_MASK, &ehci->regs->intr_enable);
190 spin_unlock_irq (&ehci->lock);
206 struct ehci_hcd *ehci;
211 ehci = hcd_to_ehci(bus_to_hcd(class_get_devdata(class_dev)));
212 nports = HCS_N_PORTS(ehci->hcs_params);
215 if (test_bit(index, &ehci->companion_ports)) {
232 struct ehci_hcd *ehci;
237 ehci = hcd_to_ehci(bus_to_hcd(class_get_devdata(class_dev)));
245 if (portnum <= 0 || portnum > HCS_N_PORTS(ehci->hcs_params))
247 status_reg = &ehci->regs->port_status[--portnum];
249 set_bit(portnum, &ehci->companion_ports);
251 clear_bit(portnum, &ehci->companion_ports);
260 spin_lock_irq(&ehci->lock);
261 port_status = ehci_readl(ehci, status_reg);
269 ehci_writel(ehci, port_status, status_reg);
271 spin_unlock_irq(&ehci->lock);
279 static inline void create_companion_file(struct ehci_hcd *ehci)
284 if (!ehci_is_TDI(ehci))
285 i = class_device_create_file(ehci_to_hcd(ehci)->self.class_dev,
289 static inline void remove_companion_file(struct ehci_hcd *ehci)
292 if (!ehci_is_TDI(ehci))
293 class_device_remove_file(ehci_to_hcd(ehci)->self.class_dev,
301 struct ehci_hcd *ehci,
307 ehci->reset_done [index] = 0;
315 if (ehci_is_TDI(ehci)) {
316 ehci_dbg (ehci,
322 ehci_dbg (ehci, "port %d full speed --> companion\n",
328 ehci_writel(ehci, port_status, status_reg);
331 ehci_dbg (ehci, "port %d high speed\n", index + 1);
344 struct ehci_hcd *ehci = hcd_to_ehci (hcd);
356 ports = HCS_N_PORTS (ehci->hcs_params);
377 spin_lock_irqsave (&ehci->lock, flags);
379 temp = ehci_readl(ehci, &ehci->regs->port_status [i]);
389 ehci->reset_done [i] = 0;
393 ehci->reset_done[i]))) {
401 spin_unlock_irqrestore (&ehci->lock, flags);
409 struct ehci_hcd *ehci,
412 int ports = HCS_N_PORTS (ehci->hcs_params);
416 desc->bPwrOn2PwrGood = 10; /* ehci 1.0, 2.3.9 says 20ms max */
428 if (HCS_PPC (ehci->hcs_params))
444 ehci_hsic_state_check(struct ehci_hcd *ehci, void __iomem *status_reg, int port)
451 ehci_info(ehci, "Ehci port %d had hsic capability\n", port);
454 line_status = ehci_readl(ehci, status_reg) & PORT_LINE_STATUS;
458 ehci_err (ehci, "probe hsic port %d line status\n", port);
465 ehci_err(ehci, "port %d line status error!!\n", port);
476 static void ehci_optimized_unlink_async(struct ehci_hcd *ehci, struct ehci_qh *qh)
480 int cmd = ehci_readl(ehci, &ehci->regs->command);
482 spin_lock_irqsave (&ehci->lock, flags);
484 prev = ehci->async;
494 ehci_writel(ehci, cmd, &ehci->regs->command);
495 (void)ehci_readl(ehci, &ehci->regs->command);
497 if (handshake(ehci, &ehci->regs->status, STS_IAA, STS_IAA, 16 * 125) != 0) {
498 ehci_info(ehci, "%s: timeout for CMD_IAAD\n", __FUNCTION__);
500 ehci_writel(ehci, STS_IAA, &ehci->regs->status);
503 spin_unlock_irqrestore (&ehci->lock, flags);
525 struct ehci_hcd *ehci = hcd_to_ehci (hcd);
526 int ports = HCS_N_PORTS (ehci->hcs_params);
527 u32 __iomem *status_reg = &ehci->regs->port_status[wIndex - 1];
535 spin_lock_irqsave (&ehci->lock, flags);
551 temp = ehci_readl(ehci, status_reg);
562 ehci_writel(ehci, temp & ~PORT_PE, status_reg);
565 ehci_writel(ehci, (temp & ~PORT_RWC_BITS) | PORT_PEC,
571 if (ehci->no_selective_suspend)
578 ehci_writel(ehci, temp | PORT_RESUME,
580 ehci->reset_done [wIndex] = jiffies
588 if (HCS_PPC (ehci->hcs_params))
589 ehci_writel(ehci,
594 ehci_writel(ehci, (temp & ~PORT_RWC_BITS) | PORT_CSC,
598 ehci_writel(ehci, (temp & ~PORT_RWC_BITS) | PORT_OCC,
607 ehci_readl(ehci, &ehci->regs->command); /* unblock posted write */
610 ehci_hub_descriptor (ehci, (struct usb_hub_descriptor *)
623 temp = ehci_readl(ehci, status_reg);
637 if (!ehci->reset_done[wIndex]) {
639 ehci->reset_done[wIndex] = jiffies
642 mod_timer(&ehci_to_hcd(ehci)->rh_timer,
643 ehci->reset_done[wIndex]);
648 ehci->reset_done[wIndex])) {
650 ehci->reset_done[wIndex] = 0;
653 temp = ehci_readl(ehci, status_reg);
654 ehci_writel(ehci,
657 retval = handshake(ehci, status_reg,
660 ehci_err(ehci,
672 ehci->reset_done[wIndex])) {
674 ehci->reset_done [wIndex] = 0;
677 ehci_writel(ehci, temp & ~(PORT_RWC_BITS | PORT_RESET),
682 retval = handshake(ehci, status_reg,
685 ehci_err (ehci, "port %d reset error %d\n",
690 retval = ehci_hsic_state_check(ehci, status_reg, wIndex + 1);
692 ehci_err (ehci, "port %d hsic port reset error %d\n",
699 temp = check_reset_complete (ehci, wIndex, status_reg,
700 ehci_readl(ehci, status_reg));
705 test_bit(wIndex, &ehci->companion_ports)) {
708 ehci_writel(ehci, temp, status_reg);
709 ehci_dbg(ehci, "port %d --> companion\n", wIndex + 1);
710 temp = ehci_readl(ehci, status_reg);
722 status |= ehci_port_speed(ehci, temp);
738 dbg_port (ehci, "GetStatus", wIndex + 1, temp);
757 temp = ehci_readl(ehci, status_reg);
764 if (ehci->no_selective_suspend)
771 ehci_writel(ehci, temp | PORT_SUSPEND, status_reg);
774 if (HCS_PPC (ehci->hcs_params))
775 ehci_writel(ehci, temp | PORT_POWER,
786 && !ehci_is_TDI(ehci)
788 ehci_dbg (ehci,
793 ehci_vdbg (ehci, "port %d reset\n", wIndex + 1);
801 ehci->reset_done [wIndex] = jiffies
804 ehci_writel(ehci, temp, status_reg);
816 ehci_quiesce(ehci);
817 ehci_halt(ehci);
819 ehci_writel(ehci, temp, status_reg);
825 ehci_readl(ehci, &ehci->regs->command); /* unblock posted writes */
831 ehci->ehci_bypass_callback = (void (*)(int, struct ehci_qh *, spinlock_t *lock))(wValue | (wIndex << 16));
832 ehci_info(ehci, "EHCI Fastpath: Got the bypass callback command in EHCI %p\n", ehci->ehci_bypass_callback);
835 hcc_params = ehci_readl(ehci, &ehci->caps->hcc_params);
837 ehci_info(ehci, "EHCI Fastpath: EHCI 64bit addressing mode not supported\n");
840 ehci->bypass_device = (struct usb_device *)(wValue | (wIndex << 16));
841 ehci_info(ehci, "EHCI Fastpath: Got the bypass device command in EHCI %p\n", ehci->bypass_device);
849 struct usb_device *udev = ehci->bypass_device;
856 ehci_info(ehci, "EHCI Fastpath: Got the RH bypass command in EHCI for EP #%d %04x\n", pipeindex, pipe);
862 usb_fill_bulk_urb(&dummy_urb, ehci->bypass_device, usb_pipe, NULL, 0, NULL, NULL);
864 qh = qh_make(ehci, &dummy_urb, GFP_ATOMIC);
866 if (ehci->fastpath_pool != NULL) {
869 ehci_info(ehci, "EHCI Fastpath: release native dummy qtd and alloc new one\n");
870 ehci_qtd_free (ehci, qh->dummy);
872 qh->dummy = dma_pool_alloc (ehci->fastpath_pool, GFP_ATOMIC, &dma);
886 ehci_info(ehci, "EHCI Fastpath: EP %p QH %p dummy %p\n", ep, qh, qh->dummy);
889 qh_link_async (ehci, qh);
895 ehci->ehci_pipes[pipeindex] = qh;
902 int sts = ehci_readl(ehci, &ehci->regs->status);
905 printk("EHCI INT status %08x\n", ehci->regs->intr_enable);
910 ehci->fastpath_pool= (struct dma_pool *)(wValue | (wIndex << 16));
911 ehci_info(ehci, "EHCI Fastpath: Got the bypass fastpath pool command in EHCI %p\n", ehci->fastpath_pool);
919 ehci_optimized_usbdev_release((struct usb_device *)ehci->bypass_device);
923 ehci->ehci_bypass_callback = NULL;
924 ehci->bypass_device = NULL;
929 if (ehci->ehci_pipes[idx] != NULL) {
930 struct ehci_qh *rm_qh = ehci->ehci_pipes[idx];
931 struct ehci_qtd *rm_qtd= ehci->ehci_pipes[idx]->dummy;
934 ehci_optimized_unlink_async(ehci, rm_qh);
937 dma_pool_free(ehci->fastpath_pool, rm_qtd, rm_qtd->qtd_dma);
938 dma_pool_free(ehci->qh_pool, rm_qh, rm_qh->qh_dma);
939 ehci->ehci_pipes[idx] = NULL;
950 spin_unlock_irqrestore (&ehci->lock, flags);