Lines Matching refs:qh

41 typedef void (packet_enqueue)(struct usb_hcd *hcd, struct isp1760_qh *qh,
661 struct isp1760_qh *qh; in qh_alloc() local
663 qh = kmem_cache_zalloc(qh_cachep, flags); in qh_alloc()
664 if (!qh) in qh_alloc()
667 INIT_LIST_HEAD(&qh->qh_list); in qh_alloc()
668 INIT_LIST_HEAD(&qh->qtd_list); in qh_alloc()
669 qh->slot = -1; in qh_alloc()
671 return qh; in qh_alloc()
674 static void qh_free(struct isp1760_qh *qh) in qh_free() argument
676 WARN_ON(!list_empty(&qh->qtd_list)); in qh_free()
677 WARN_ON(qh->slot > -1); in qh_free()
678 kmem_cache_free(qh_cachep, qh); in qh_free()
797 static int last_qtd_of_urb(struct isp1760_qtd *qtd, struct isp1760_qh *qh) in last_qtd_of_urb() argument
801 if (list_is_last(&qtd->qtd_list, &qh->qtd_list)) in last_qtd_of_urb()
817 static void create_ptd_atl(struct isp1760_qh *qh, in create_ptd_atl() argument
869 ptd->dw3 |= TO_DW3_PING(qh->ping); in create_ptd_atl()
878 ptd->dw3 |= TO_DW3_DATA_TOGGLE(qh->toggle); in create_ptd_atl()
882 else if (last_qtd_of_urb(qtd, qh)) in create_ptd_atl()
891 static void transform_add_int(struct isp1760_qh *qh, in transform_add_int() argument
943 static void create_ptd_int(struct isp1760_qh *qh, in create_ptd_int() argument
946 create_ptd_atl(qh, qtd, ptd); in create_ptd_int()
947 transform_add_int(qh, qtd, ptd); in create_ptd_int()
1002 struct isp1760_qtd *qtd, struct isp1760_qh *qh, in start_bus_transfer() argument
1012 WARN_ON(slots[slot].qh); in start_bus_transfer()
1034 qh->slot = slot; in start_bus_transfer()
1038 slots[slot].qh = qh; in start_bus_transfer()
1053 static void collect_qtds(struct usb_hcd *hcd, struct isp1760_qh *qh, in collect_qtds() argument
1060 list_for_each_entry_safe(qtd, qtd_next, &qh->qtd_list, qtd_list) { in collect_qtds()
1064 last_qtd = last_qtd_of_urb(qtd, qh); in collect_qtds()
1116 static void enqueue_qtds(struct usb_hcd *hcd, struct isp1760_qh *qh) in enqueue_qtds() argument
1128 if (unlikely(list_empty(&qh->qtd_list))) { in enqueue_qtds()
1134 if (qh->tt_buffer_dirty) in enqueue_qtds()
1137 if (usb_pipeint(list_entry(qh->qtd_list.next, struct isp1760_qtd, in enqueue_qtds()
1150 if (slots[curr_slot].qh == qh) in enqueue_qtds()
1155 list_for_each_entry(qtd, &qh->qtd_list, qtd_list) { in enqueue_qtds()
1180 create_ptd_int(qh, qtd, &ptd); in enqueue_qtds()
1182 create_ptd_atl(qh, qtd, &ptd); in enqueue_qtds()
1185 slots, qtd, qh, &ptd); in enqueue_qtds()
1199 struct isp1760_qh *qh, *qh_next; in schedule_ptds() local
1217 list_for_each_entry_safe(qh, qh_next, ep_queue, qh_list) { in schedule_ptds()
1218 collect_qtds(hcd, qh, &urb_list); in schedule_ptds()
1219 if (list_empty(&qh->qtd_list)) in schedule_ptds()
1220 list_del(&qh->qh_list); in schedule_ptds()
1256 list_for_each_entry_safe(qh, qh_next, ep_queue, qh_list) in schedule_ptds()
1257 enqueue_qtds(hcd, qh); in schedule_ptds()
1356 struct isp1760_qh *qh; in handle_done_ptds() local
1380 if (!slots[slot].qh) { in handle_done_ptds()
1395 if (!slots[slot].qh) { in handle_done_ptds()
1407 qh = slots[slot].qh; in handle_done_ptds()
1408 slots[slot].qh = NULL; in handle_done_ptds()
1409 qh->slot = -1; in handle_done_ptds()
1424 if (list_is_last(&qtd->qtd_list, &qh->qtd_list) || in handle_done_ptds()
1431 qh->toggle = FROM_DW3_DATA_TOGGLE(ptd.dw3); in handle_done_ptds()
1432 qh->ping = FROM_DW3_PING(ptd.dw3); in handle_done_ptds()
1443 qh->toggle = FROM_DW3_DATA_TOGGLE(ptd.dw3); in handle_done_ptds()
1444 qh->ping = FROM_DW3_PING(ptd.dw3); in handle_done_ptds()
1452 qh->tt_buffer_dirty = 1; in handle_done_ptds()
1456 qh->tt_buffer_dirty = 0; in handle_done_ptds()
1459 qh->toggle = 0; in handle_done_ptds()
1460 qh->ping = 0; in handle_done_ptds()
1475 create_ptd_int(qh, qtd, &ptd); in handle_done_ptds()
1478 create_ptd_atl(qh, qtd, &ptd); in handle_done_ptds()
1482 qh, &ptd); in handle_done_ptds()
1565 if (priv->atl_slots[slot].qh && time_after(jiffies, in errata2_function()
1883 struct isp1760_qh *qh, *qhit; in isp1760_urb_enqueue() local
1933 qh = urb->ep->hcpriv; in isp1760_urb_enqueue()
1934 if (qh) { in isp1760_urb_enqueue()
1937 if (qhit == qh) { in isp1760_urb_enqueue()
1943 list_add_tail(&qh->qh_list, ep_queue); in isp1760_urb_enqueue()
1945 qh = qh_alloc(GFP_ATOMIC); in isp1760_urb_enqueue()
1946 if (!qh) { in isp1760_urb_enqueue()
1952 list_add_tail(&qh->qh_list, ep_queue); in isp1760_urb_enqueue()
1953 urb->ep->hcpriv = qh; in isp1760_urb_enqueue()
1956 list_splice_tail(&new_qtds, &qh->qtd_list); in isp1760_urb_enqueue()
1965 struct isp1760_qh *qh) in kill_transfer() argument
1970 WARN_ON(qh->slot == -1); in kill_transfer()
1975 if (qh->slot != -1) { in kill_transfer()
1977 skip_map |= (1 << qh->slot); in kill_transfer()
1981 priv->atl_slots[qh->slot].qh = NULL; in kill_transfer()
1982 priv->atl_slots[qh->slot].qtd = NULL; in kill_transfer()
1984 if (qh->slot != -1) { in kill_transfer()
1986 skip_map |= (1 << qh->slot); in kill_transfer()
1989 priv->int_slots[qh->slot].qh = NULL; in kill_transfer()
1990 priv->int_slots[qh->slot].qtd = NULL; in kill_transfer()
1993 qh->slot = -1; in kill_transfer()
2000 static void dequeue_urb_from_qtd(struct usb_hcd *hcd, struct isp1760_qh *qh, in dequeue_urb_from_qtd() argument
2008 list_for_each_entry_from(qtd, &qh->qtd_list, qtd_list) { in dequeue_urb_from_qtd()
2014 if (last_qtd_of_urb(qtd, qh) && in dequeue_urb_from_qtd()
2019 kill_transfer(hcd, urb, qh); in dequeue_urb_from_qtd()
2024 qh->tt_buffer_dirty = 1; in dequeue_urb_from_qtd()
2027 qh->tt_buffer_dirty = 0; in dequeue_urb_from_qtd()
2036 struct isp1760_qh *qh; in isp1760_urb_dequeue() local
2045 qh = urb->ep->hcpriv; in isp1760_urb_dequeue()
2046 if (!qh) { in isp1760_urb_dequeue()
2051 list_for_each_entry(qtd, &qh->qtd_list, qtd_list) in isp1760_urb_dequeue()
2053 dequeue_urb_from_qtd(hcd, qh, qtd); in isp1760_urb_dequeue()
2054 list_move(&qtd->qtd_list, &qh->qtd_list); in isp1760_urb_dequeue()
2071 struct isp1760_qh *qh, *qh_iter; in isp1760_endpoint_disable() local
2076 qh = ep->hcpriv; in isp1760_endpoint_disable()
2077 if (!qh) in isp1760_endpoint_disable()
2080 WARN_ON(!list_empty(&qh->qtd_list)); in isp1760_endpoint_disable()
2084 if (qh_iter == qh) { in isp1760_endpoint_disable()
2089 qh_free(qh); in isp1760_endpoint_disable()
2489 struct isp1760_qh *qh = ep->hcpriv; in isp1760_clear_tt_buffer_complete() local
2492 if (!qh) in isp1760_clear_tt_buffer_complete()
2496 qh->tt_buffer_dirty = 0; in isp1760_clear_tt_buffer_complete()