Lines Matching refs:qh
467 if (ehci->async->qh_next.qh) in ehci_ready()
474 printk("Got problem,check it out, qHD is %p\n",ehci->async->qh_next.qh); in ehci_ready()
1343 if( ehci->async->qh_next.qh != 0 ) in ehci_hub_control()
1345 …usb_err("Not only cantain one qHD (%p and %p)in asyn. scheduler",ehci->async->qh_next.qh,ehci->asy… in ehci_hub_control()
2161 qh_update (struct ehci_hcd *ehci, struct ehci_qh *qh, struct ehci_qtd *qtd) in qh_update() argument
2163 qh->hw_qtd_next = QTD_NEXT (qtd->qtd_dma); in qh_update()
2164 qh->hw_alt_next = EHCI_LIST_END; in qh_update()
2218 qh->hw_token &= CPUToLE32 (QTD_TOGGLE | QTD_STS_PING); in qh_update()
2661 struct ehci_qh *qh = (struct ehci_qh *) urb->hcpriv; in ehci_urb_done() local
2664 if ((qh->hw_info2 & CPUToLE32 (0x00ff)) != 0) { in ehci_urb_done()
2669 qh_put (ehci, qh); in ehci_urb_done()
2898 qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh, struct pt_regs *regs) in qh_completions() argument
2900 struct ehci_qtd *last = 0, *end = qh->dummy; in qh_completions()
2956 if (unlikely (list_empty (&qh->qtd_list))) in qh_completions()
2959 state = qh->qh_state; in qh_completions()
2960 qh->qh_state = QH_STATE_COMPLETING; in qh_completions()
3011 list_for_each_safe (entry, tmp, &qh->qtd_list) { in qh_completions()
3149 && (qh->hw_alt_next & QTD_MASK) in qh_completions()
3230 == qh->hw_current) in qh_completions()
3231 token = LE32ToCPU (qh->hw_token); in qh_completions()
3233 if ((HALT_BIT & qh->hw_token) == 0) { in qh_completions()
3235 qh->hw_token |= HALT_BIT; in qh_completions()
3302 if (stopped && qtd->qtd_list.prev != &qh->qtd_list) { in qh_completions()
3367 qh->qh_state = state; in qh_completions()
3371 || qh->hw_qtd_next == EHCI_LIST_END) { in qh_completions()
3372 if (list_empty (&qh->qtd_list)) in qh_completions()
3373 end = qh->dummy; in qh_completions()
3375 end = list_entry (qh->qtd_list.next,struct ehci_qtd, qtd_list); in qh_completions()
3377 if (CPUToLE32 (end->qtd_dma) == qh->hw_current) in qh_completions()
3381 qh_update (ehci, qh, end); in qh_completions()
4278 clear_toggle (struct usb_device *udev, int ep, int is_out, struct ehci_qh *qh) in clear_toggle() argument
4282 qh->hw_token &= ~(CPUToLE32(QTD_TOGGLE)); in clear_toggle()
4440 struct ehci_qh *qh = ehci_qh_alloc (ehci, flags); in qh_make() local
4445 if (!qh) in qh_make()
4446 return qh; in qh_make()
4602 qh->usecs = usb_calc_bus_time (USB_SPEED_HIGH, is_input, 0, in qh_make()
4609 qh->start = NO_FRAME; in qh_make()
4612 qh->c_usecs = 0; in qh_make()
4613 qh->gap_uf = 0; in qh_make()
4616 qh->period = urb->interval >> 3; in qh_make()
4617 if (qh->period < 1) { in qh_make()
4674 qh->gap_uf = 1 + usb_calc_bus_time (urb->dev->speed, in qh_make()
4679 qh->c_usecs = qh->usecs + HS_USECS (0); in qh_make()
4680 qh->usecs = HS_USECS (1); in qh_make()
4682 qh->usecs += HS_USECS (1); in qh_make()
4683 qh->c_usecs = HS_USECS (0); in qh_make()
4685 qh->period = urb->interval; in qh_make()
4687 qh->period = urb->interval >> 3; in qh_make()
4920 qh_put (ehci, qh); in qh_make()
4975 qh->qh_state = QH_STATE_IDLE; in qh_make()
4976 qh->hw_info1 = CPUToLE32 (info1); in qh_make()
4977 qh->hw_info2 = CPUToLE32 (info2); in qh_make()
4978 qh_update (ehci, qh, qh->dummy); in qh_make()
4980 return qh; in qh_make()
4987 static void qh_link_async (struct ehci_hcd *ehci, struct ehci_qh *qh) in qh_link_async() argument
4989 U32 dma = QH_NEXT (qh->qh_dma); in qh_link_async()
5045 if (!head->qh_next.qh) { in qh_link_async()
5059 qh->hw_token &= ~HALT_BIT; in qh_link_async()
5110 qh->qh_next = head->qh_next; in qh_link_async()
5111 qh->hw_next = head->hw_next; in qh_link_async()
5114 head->qh_next.qh = qh; in qh_link_async()
5117 qh->qh_state = QH_STATE_LINKED; in qh_link_async()
5122 static void qh_link_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
5124 U32 dma = QH_NEXT (qh->qh_dma);
5184 qh->hw_info1 |= CPUToLE32 (QH_HEAD); /* [4.8] */
5185 qh->qh_next.qh = qh;
5186 qh->hw_next = dma;
5188 ehci->async = qh;
5189 ehci_writel ((U32)qh->qh_dma, &ehci->regs->async_next);
5196 qh->hw_info1 &= ~ CPUToLE32(QH_HEAD); /* [4.8] */
5197 qh->qh_next = q->qh_next;
5198 qh->hw_next = q->hw_next;
5200 q->qh_next.qh = qh;
5203 qh->qh_state = QH_STATE_LINKED;
5268 struct ehci_qh *qh = 0; in qh_append_tds() local
5270 qh = (struct ehci_qh *) *ptr; in qh_append_tds()
5271 if (unlikely (qh == 0)) { in qh_append_tds()
5273 qh = qh_make (ehci, urb, SLAB_ATOMIC); in qh_append_tds()
5274 *ptr = qh; in qh_append_tds()
5332 …qh->hw_info1 = CPUToLE32((LE32ToCPU(qh->hw_info1)&(~(((1<<11)-1)<<16)))|(usb_maxpacket (urb->dev, … in qh_append_tds()
5335 if (likely (qh != 0)) { in qh_append_tds()
5349 if ((qh->hw_info1 & QH_ADDR_MASK) == 0) in qh_append_tds()
5350 qh->hw_info1 |= CPUToLE32( in qh_append_tds()
5402 else if (!(qh->hw_info1 in qh_append_tds()
5406 info = LE32ToCPU(qh->hw_info1); in qh_append_tds()
5411 qh->hw_info1 = CPUToLE32(info); in qh_append_tds()
5417 qh->hw_info1 &= ~QH_ADDR_MASK; in qh_append_tds()
5424 if (qh->qh_state != QH_STATE_IDLE in qh_append_tds()
5425 && !list_empty (&qh->qtd_list) in qh_append_tds()
5426 && qh->qh_state != QH_STATE_COMPLETING) in qh_append_tds()
5430 epnum & 0x0f, !(epnum & 0x10), qh); in qh_append_tds()
5489 dummy = qh->dummy; in qh_append_tds()
5497 __list_splice (qtd_list, qh->qtd_list.prev); in qh_append_tds()
5548 qh->dummy = qtd; in qh_append_tds()
5552 qtd = list_entry (qh->qtd_list.prev, struct ehci_qtd, qtd_list); in qh_append_tds()
5561 urb->hcpriv = qh_get (qh); in qh_append_tds()
5564 return qh; in qh_append_tds()
5580 struct ehci_qh *qh = 0; in submit_async() local
5691 qh = qh_append_tds (ehci, urb, qtd_list, epnum, &dev->ep [epnum]); in submit_async()
5696 if (likely (qh != 0)) { in submit_async()
5697 if (likely (qh->qh_state == QH_STATE_IDLE)) in submit_async()
5698 qh_link_async (ehci, qh_get (qh)); in submit_async()
5706 if (unlikely (qh == 0)) { in submit_async()
5716 static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh);
5768 struct ehci_qh *qh = ehci->reclaim; in end_unlink_async() local
5770 if(qh == NULL) in end_unlink_async()
5775 qh->qh_state = QH_STATE_IDLE; in end_unlink_async()
5776 qh->qh_next.qh = 0; in end_unlink_async()
5777 qh_put (ehci, qh); // refcount from reclaim in end_unlink_async()
5780 next = qh->reclaim; in end_unlink_async()
5783 qh->reclaim = 0; in end_unlink_async()
5833 qh_completions (ehci, qh, regs); in end_unlink_async()
5835 if (!list_empty (&qh->qtd_list) 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()
5842 && ehci->async->qh_next.qh == 0) in end_unlink_async()
5901 static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh) in start_unlink_async() argument
5908 || (qh->qh_state != QH_STATE_LINKED in start_unlink_async()
5909 && qh->qh_state != QH_STATE_UNLINK_WAIT) in start_unlink_async()
5967 if (unlikely (qh == ehci->async)) { in start_unlink_async()
5978 qh->qh_state = QH_STATE_UNLINK; in start_unlink_async()
5979 ehci->reclaim = qh = qh_get (qh); in start_unlink_async()
5982 while (prev->qh_next.qh != qh) in start_unlink_async()
5983 prev = prev->qh_next.qh; in start_unlink_async()
5985 prev->hw_next = qh->hw_next; in start_unlink_async()
5986 prev->qh_next = qh->qh_next; in start_unlink_async()
6110 struct ehci_qh *qh; in scan_async() local
6165 qh = ehci->async->qh_next.qh; in scan_async()
6166 if (likely (qh != 0)) { in scan_async()
6169 if (!list_empty (&qh->qtd_list) in scan_async()
6170 && qh->stamp != ehci->stamp) { in scan_async()
6221 qh = qh_get (qh); 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()
6284 if (list_empty (&qh->qtd_list)) { in scan_async()
6285 if (qh->stamp == ehci->stamp) in scan_async()
6288 && qh->qh_state == QH_STATE_LINKED) in scan_async()
6289 start_unlink_async (ehci, qh); in scan_async()
6341 if (list_empty (&qh->qtd_list)) { 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()
6346 qh = qh->qh_next.qh; in scan_async()
6347 } while (qh); in scan_async()
6986 ehci->async->qh_next.qh = 0; in ehci_start()
8420 struct ehci_qh *qh; in ehci_urb_dequeue() local
8480 qh = (struct ehci_qh *) urb->hcpriv; in ehci_urb_dequeue()
8481 if (!qh) in ehci_urb_dequeue()
8485 if (qh->qh_state == QH_STATE_LINKED in ehci_urb_dequeue()
8495 qh->qh_state = QH_STATE_UNLINK_WAIT; in ehci_urb_dequeue()
8496 last->reclaim = qh; in ehci_urb_dequeue()
8550 if (qh->qh_state == QH_STATE_LINKED) in ehci_urb_dequeue()
8551 start_unlink_async (ehci, qh); in ehci_urb_dequeue()
8685 qh = (struct ehci_qh *) urb->hcpriv; in ehci_urb_dequeue()
8686 if (!qh) in ehci_urb_dequeue()
8688 if (qh->qh_state == QH_STATE_LINKED) { in ehci_urb_dequeue()
8690 intr_deschedule (ehci, qh, 1); in ehci_urb_dequeue()
8693 qh_completions (ehci, qh, NULL); in ehci_urb_dequeue()
8745 if (!list_empty (&qh->qtd_list) in ehci_urb_dequeue()
8749 status = qh_schedule (ehci, qh); in ehci_urb_dequeue()
8804 qh, status); in ehci_urb_dequeue()
8928 struct ehci_qh *qh; in ehci_endpoint_disable() local
8987 qh = (struct ehci_qh *) dev->ep [epnum]; in ehci_endpoint_disable()
8988 if (!qh) in ehci_endpoint_disable()
8992 qh->qh_state = QH_STATE_IDLE; in ehci_endpoint_disable()
9042 switch (qh->qh_state) { in ehci_endpoint_disable()
9049 if (list_empty (&qh->qtd_list)) { in ehci_endpoint_disable()
9050 qh_put (ehci, qh); in ehci_endpoint_disable()
9107 if ( !list_empty (&qh->qtd_list)) in ehci_endpoint_disable()
9110 qh, epnum, qh->qh_state, in ehci_endpoint_disable()
9111 list_empty (&qh->qtd_list) ? "" : "(has tds)"); in ehci_endpoint_disable()