Lines Matching refs:qh

39 typedef void (packet_enqueue)(struct usb_hcd *hcd, struct isp1760_qh *qh,
412 struct isp1760_qh *qh; in qh_alloc() local
414 qh = kmem_cache_zalloc(qh_cachep, flags); in qh_alloc()
415 if (!qh) in qh_alloc()
418 INIT_LIST_HEAD(&qh->qh_list); in qh_alloc()
419 INIT_LIST_HEAD(&qh->qtd_list); in qh_alloc()
420 qh->slot = -1; in qh_alloc()
422 return qh; in qh_alloc()
425 static void qh_free(struct isp1760_qh *qh) in qh_free() argument
427 WARN_ON(!list_empty(&qh->qtd_list)); in qh_free()
428 WARN_ON(qh->slot > -1); in qh_free()
429 kmem_cache_free(qh_cachep, qh); in qh_free()
513 static int last_qtd_of_urb(struct isp1760_qtd *qtd, struct isp1760_qh *qh) in last_qtd_of_urb() argument
517 if (list_is_last(&qtd->qtd_list, &qh->qtd_list)) in last_qtd_of_urb()
533 static void create_ptd_atl(struct isp1760_qh *qh, in create_ptd_atl() argument
586 ptd->dw3 |= TO_DW3_PING(qh->ping); in create_ptd_atl()
595 ptd->dw3 |= TO_DW3_DATA_TOGGLE(qh->toggle); in create_ptd_atl()
599 else if (last_qtd_of_urb(qtd, qh)) in create_ptd_atl()
608 static void transform_add_int(struct isp1760_qh *qh, in transform_add_int() argument
660 static void create_ptd_int(struct isp1760_qh *qh, in create_ptd_int() argument
663 create_ptd_atl(qh, qtd, ptd); in create_ptd_int()
664 transform_add_int(qh, qtd, ptd); in create_ptd_int()
719 struct isp1760_qtd *qtd, struct isp1760_qh *qh, in start_bus_transfer() argument
728 WARN_ON(slots[slot].qh); in start_bus_transfer()
742 qh->slot = slot; in start_bus_transfer()
746 slots[slot].qh = qh; in start_bus_transfer()
751 skip_map &= ~(1 << qh->slot); in start_bus_transfer()
755 skip_map &= ~(1 << qh->slot); in start_bus_transfer()
766 static void collect_qtds(struct usb_hcd *hcd, struct isp1760_qh *qh, in collect_qtds() argument
773 list_for_each_entry_safe(qtd, qtd_next, &qh->qtd_list, qtd_list) { in collect_qtds()
777 last_qtd = last_qtd_of_urb(qtd, qh); in collect_qtds()
829 static void enqueue_qtds(struct usb_hcd *hcd, struct isp1760_qh *qh) in enqueue_qtds() argument
839 if (unlikely(list_empty(&qh->qtd_list))) { in enqueue_qtds()
845 if (qh->tt_buffer_dirty) in enqueue_qtds()
848 if (usb_pipeint(list_entry(qh->qtd_list.next, struct isp1760_qtd, in enqueue_qtds()
861 if (slots[curr_slot].qh == qh) in enqueue_qtds()
866 list_for_each_entry(qtd, &qh->qtd_list, qtd_list) { in enqueue_qtds()
892 create_ptd_int(qh, qtd, &ptd); in enqueue_qtds()
894 create_ptd_atl(qh, qtd, &ptd); in enqueue_qtds()
897 slots, qtd, qh, &ptd); in enqueue_qtds()
911 struct isp1760_qh *qh, *qh_next; in schedule_ptds() local
929 list_for_each_entry_safe(qh, qh_next, ep_queue, qh_list) { in schedule_ptds()
930 collect_qtds(hcd, qh, &urb_list); in schedule_ptds()
931 if (list_empty(&qh->qtd_list)) in schedule_ptds()
932 list_del(&qh->qh_list); in schedule_ptds()
968 list_for_each_entry_safe(qh, qh_next, ep_queue, qh_list) in schedule_ptds()
969 enqueue_qtds(hcd, qh); in schedule_ptds()
1068 struct isp1760_qh *qh; in handle_done_ptds() local
1092 if (!slots[slot].qh) { in handle_done_ptds()
1107 if (!slots[slot].qh) { in handle_done_ptds()
1119 qh = slots[slot].qh; in handle_done_ptds()
1120 slots[slot].qh = NULL; in handle_done_ptds()
1121 qh->slot = -1; in handle_done_ptds()
1136 if (list_is_last(&qtd->qtd_list, &qh->qtd_list) || in handle_done_ptds()
1143 qh->toggle = FROM_DW3_DATA_TOGGLE(ptd.dw3); in handle_done_ptds()
1144 qh->ping = FROM_DW3_PING(ptd.dw3); in handle_done_ptds()
1155 qh->toggle = FROM_DW3_DATA_TOGGLE(ptd.dw3); in handle_done_ptds()
1156 qh->ping = FROM_DW3_PING(ptd.dw3); in handle_done_ptds()
1164 qh->tt_buffer_dirty = 1; in handle_done_ptds()
1168 qh->tt_buffer_dirty = 0; in handle_done_ptds()
1171 qh->toggle = 0; in handle_done_ptds()
1172 qh->ping = 0; in handle_done_ptds()
1187 create_ptd_int(qh, qtd, &ptd); in handle_done_ptds()
1190 create_ptd_atl(qh, qtd, &ptd); in handle_done_ptds()
1194 qh, &ptd); in handle_done_ptds()
1271 if (priv->atl_slots[slot].qh && time_after(jiffies, in errata2_function()
1494 struct isp1760_qh *qh, *qhit; in isp1760_urb_enqueue() local
1545 qh = urb->ep->hcpriv; in isp1760_urb_enqueue()
1546 if (qh) { in isp1760_urb_enqueue()
1549 if (qhit == qh) { in isp1760_urb_enqueue()
1555 list_add_tail(&qh->qh_list, ep_queue); in isp1760_urb_enqueue()
1557 qh = qh_alloc(GFP_ATOMIC); in isp1760_urb_enqueue()
1558 if (!qh) { in isp1760_urb_enqueue()
1564 list_add_tail(&qh->qh_list, ep_queue); in isp1760_urb_enqueue()
1565 urb->ep->hcpriv = qh; in isp1760_urb_enqueue()
1568 list_splice_tail(&new_qtds, &qh->qtd_list); in isp1760_urb_enqueue()
1577 struct isp1760_qh *qh) in kill_transfer() argument
1582 WARN_ON(qh->slot == -1); in kill_transfer()
1588 skip_map |= (1 << qh->slot); in kill_transfer()
1590 priv->atl_slots[qh->slot].qh = NULL; in kill_transfer()
1591 priv->atl_slots[qh->slot].qtd = NULL; in kill_transfer()
1594 skip_map |= (1 << qh->slot); in kill_transfer()
1596 priv->int_slots[qh->slot].qh = NULL; in kill_transfer()
1597 priv->int_slots[qh->slot].qtd = NULL; in kill_transfer()
1600 qh->slot = -1; in kill_transfer()
1607 static void dequeue_urb_from_qtd(struct usb_hcd *hcd, struct isp1760_qh *qh, in dequeue_urb_from_qtd() argument
1615 list_for_each_entry_from(qtd, &qh->qtd_list, qtd_list) { in dequeue_urb_from_qtd()
1621 if (last_qtd_of_urb(qtd, qh) && in dequeue_urb_from_qtd()
1626 kill_transfer(hcd, urb, qh); in dequeue_urb_from_qtd()
1631 qh->tt_buffer_dirty = 1; in dequeue_urb_from_qtd()
1634 qh->tt_buffer_dirty = 0; in dequeue_urb_from_qtd()
1643 struct isp1760_qh *qh; in isp1760_urb_dequeue() local
1652 qh = urb->ep->hcpriv; in isp1760_urb_dequeue()
1653 if (!qh) { in isp1760_urb_dequeue()
1658 list_for_each_entry(qtd, &qh->qtd_list, qtd_list) in isp1760_urb_dequeue()
1660 dequeue_urb_from_qtd(hcd, qh, qtd); in isp1760_urb_dequeue()
1661 list_move(&qtd->qtd_list, &qh->qtd_list); in isp1760_urb_dequeue()
1678 struct isp1760_qh *qh, *qh_iter; in isp1760_endpoint_disable() local
1683 qh = ep->hcpriv; in isp1760_endpoint_disable()
1684 if (!qh) in isp1760_endpoint_disable()
1687 WARN_ON(!list_empty(&qh->qtd_list)); in isp1760_endpoint_disable()
1691 if (qh_iter == qh) { in isp1760_endpoint_disable()
1696 qh_free(qh); in isp1760_endpoint_disable()
2119 struct isp1760_qh *qh = ep->hcpriv; in isp1760_clear_tt_buffer_complete() local
2122 if (!qh) in isp1760_clear_tt_buffer_complete()
2126 qh->tt_buffer_dirty = 0; in isp1760_clear_tt_buffer_complete()