Lines Matching refs:qh

37 typedef void (packet_enqueue)(struct usb_hcd *hcd, struct isp1760_qh *qh,
415 struct isp1760_qh *qh; in qh_alloc() local
417 qh = kmem_cache_zalloc(qh_cachep, flags); in qh_alloc()
418 if (!qh) in qh_alloc()
421 INIT_LIST_HEAD(&qh->qh_list); in qh_alloc()
422 INIT_LIST_HEAD(&qh->qtd_list); in qh_alloc()
423 qh->slot = -1; in qh_alloc()
425 return qh; in qh_alloc()
428 static void qh_free(struct isp1760_qh *qh) in qh_free() argument
430 WARN_ON(!list_empty(&qh->qtd_list)); in qh_free()
431 WARN_ON(qh->slot > -1); in qh_free()
432 kmem_cache_free(qh_cachep, qh); in qh_free()
516 static int last_qtd_of_urb(struct isp1760_qtd *qtd, struct isp1760_qh *qh) in last_qtd_of_urb() argument
520 if (list_is_last(&qtd->qtd_list, &qh->qtd_list)) in last_qtd_of_urb()
536 static void create_ptd_atl(struct isp1760_qh *qh, in create_ptd_atl() argument
589 ptd->dw3 |= TO_DW3_PING(qh->ping); in create_ptd_atl()
598 ptd->dw3 |= TO_DW3_DATA_TOGGLE(qh->toggle); in create_ptd_atl()
602 else if (last_qtd_of_urb(qtd, qh)) in create_ptd_atl()
611 static void transform_add_int(struct isp1760_qh *qh, in transform_add_int() argument
663 static void create_ptd_int(struct isp1760_qh *qh, in create_ptd_int() argument
666 create_ptd_atl(qh, qtd, ptd); in create_ptd_int()
667 transform_add_int(qh, qtd, ptd); in create_ptd_int()
722 struct isp1760_qtd *qtd, struct isp1760_qh *qh, in start_bus_transfer() argument
731 WARN_ON(slots[slot].qh); in start_bus_transfer()
745 qh->slot = slot; in start_bus_transfer()
749 slots[slot].qh = qh; in start_bus_transfer()
754 skip_map &= ~(1 << qh->slot); in start_bus_transfer()
758 skip_map &= ~(1 << qh->slot); in start_bus_transfer()
769 static void collect_qtds(struct usb_hcd *hcd, struct isp1760_qh *qh, in collect_qtds() argument
776 list_for_each_entry_safe(qtd, qtd_next, &qh->qtd_list, qtd_list) { in collect_qtds()
780 last_qtd = last_qtd_of_urb(qtd, qh); in collect_qtds()
832 static void enqueue_qtds(struct usb_hcd *hcd, struct isp1760_qh *qh) in enqueue_qtds() argument
842 if (unlikely(list_empty(&qh->qtd_list))) { in enqueue_qtds()
848 if (qh->tt_buffer_dirty) in enqueue_qtds()
851 if (usb_pipeint(list_entry(qh->qtd_list.next, struct isp1760_qtd, in enqueue_qtds()
864 if (slots[curr_slot].qh == qh) in enqueue_qtds()
869 list_for_each_entry(qtd, &qh->qtd_list, qtd_list) { in enqueue_qtds()
895 create_ptd_int(qh, qtd, &ptd); in enqueue_qtds()
897 create_ptd_atl(qh, qtd, &ptd); in enqueue_qtds()
900 slots, qtd, qh, &ptd); in enqueue_qtds()
914 struct isp1760_qh *qh, *qh_next; in schedule_ptds() local
932 list_for_each_entry_safe(qh, qh_next, ep_queue, qh_list) { in schedule_ptds()
933 collect_qtds(hcd, qh, &urb_list); in schedule_ptds()
934 if (list_empty(&qh->qtd_list)) in schedule_ptds()
935 list_del(&qh->qh_list); in schedule_ptds()
971 list_for_each_entry_safe(qh, qh_next, ep_queue, qh_list) in schedule_ptds()
972 enqueue_qtds(hcd, qh); in schedule_ptds()
1073 struct isp1760_qh *qh; in handle_done_ptds() local
1097 if (!slots[slot].qh) { in handle_done_ptds()
1112 if (!slots[slot].qh) { in handle_done_ptds()
1124 qh = slots[slot].qh; in handle_done_ptds()
1125 slots[slot].qh = NULL; in handle_done_ptds()
1126 qh->slot = -1; in handle_done_ptds()
1141 if (list_is_last(&qtd->qtd_list, &qh->qtd_list) || in handle_done_ptds()
1148 qh->toggle = FROM_DW3_DATA_TOGGLE(ptd.dw3); in handle_done_ptds()
1149 qh->ping = FROM_DW3_PING(ptd.dw3); in handle_done_ptds()
1160 qh->toggle = FROM_DW3_DATA_TOGGLE(ptd.dw3); in handle_done_ptds()
1161 qh->ping = FROM_DW3_PING(ptd.dw3); in handle_done_ptds()
1169 qh->tt_buffer_dirty = 1; in handle_done_ptds()
1173 qh->tt_buffer_dirty = 0; in handle_done_ptds()
1176 qh->toggle = 0; in handle_done_ptds()
1177 qh->ping = 0; in handle_done_ptds()
1192 create_ptd_int(qh, qtd, &ptd); in handle_done_ptds()
1195 create_ptd_atl(qh, qtd, &ptd); in handle_done_ptds()
1199 qh, &ptd); in handle_done_ptds()
1275 if (priv->atl_slots[slot].qh && time_after(jiffies, in errata2_function()
1497 struct isp1760_qh *qh, *qhit; in isp1760_urb_enqueue() local
1548 qh = urb->ep->hcpriv; in isp1760_urb_enqueue()
1549 if (qh) { in isp1760_urb_enqueue()
1552 if (qhit == qh) { in isp1760_urb_enqueue()
1558 list_add_tail(&qh->qh_list, ep_queue); in isp1760_urb_enqueue()
1560 qh = qh_alloc(GFP_ATOMIC); in isp1760_urb_enqueue()
1561 if (!qh) { in isp1760_urb_enqueue()
1567 list_add_tail(&qh->qh_list, ep_queue); in isp1760_urb_enqueue()
1568 urb->ep->hcpriv = qh; in isp1760_urb_enqueue()
1571 list_splice_tail(&new_qtds, &qh->qtd_list); in isp1760_urb_enqueue()
1580 struct isp1760_qh *qh) in kill_transfer() argument
1585 WARN_ON(qh->slot == -1); in kill_transfer()
1591 skip_map |= (1 << qh->slot); in kill_transfer()
1593 priv->atl_slots[qh->slot].qh = NULL; in kill_transfer()
1594 priv->atl_slots[qh->slot].qtd = NULL; in kill_transfer()
1597 skip_map |= (1 << qh->slot); in kill_transfer()
1599 priv->int_slots[qh->slot].qh = NULL; in kill_transfer()
1600 priv->int_slots[qh->slot].qtd = NULL; in kill_transfer()
1603 qh->slot = -1; in kill_transfer()
1610 static void dequeue_urb_from_qtd(struct usb_hcd *hcd, struct isp1760_qh *qh, in dequeue_urb_from_qtd() argument
1618 list_for_each_entry_from(qtd, &qh->qtd_list, qtd_list) { in dequeue_urb_from_qtd()
1624 if (last_qtd_of_urb(qtd, qh) && in dequeue_urb_from_qtd()
1629 kill_transfer(hcd, urb, qh); in dequeue_urb_from_qtd()
1634 qh->tt_buffer_dirty = 1; in dequeue_urb_from_qtd()
1637 qh->tt_buffer_dirty = 0; in dequeue_urb_from_qtd()
1646 struct isp1760_qh *qh; in isp1760_urb_dequeue() local
1655 qh = urb->ep->hcpriv; in isp1760_urb_dequeue()
1656 if (!qh) { in isp1760_urb_dequeue()
1661 list_for_each_entry(qtd, &qh->qtd_list, qtd_list) in isp1760_urb_dequeue()
1663 dequeue_urb_from_qtd(hcd, qh, qtd); in isp1760_urb_dequeue()
1664 list_move(&qtd->qtd_list, &qh->qtd_list); in isp1760_urb_dequeue()
1681 struct isp1760_qh *qh, *qh_iter; in isp1760_endpoint_disable() local
1686 qh = ep->hcpriv; in isp1760_endpoint_disable()
1687 if (!qh) in isp1760_endpoint_disable()
1690 WARN_ON(!list_empty(&qh->qtd_list)); in isp1760_endpoint_disable()
1694 if (qh_iter == qh) { in isp1760_endpoint_disable()
1699 qh_free(qh); in isp1760_endpoint_disable()
2124 struct isp1760_qh *qh = ep->hcpriv; in isp1760_clear_tt_buffer_complete() local
2127 if (!qh) in isp1760_clear_tt_buffer_complete()
2131 qh->tt_buffer_dirty = 0; in isp1760_clear_tt_buffer_complete()