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
870 ptd->dw3 |= TO_DW3_PING(qh->ping); in create_ptd_atl()
879 ptd->dw3 |= TO_DW3_DATA_TOGGLE(qh->toggle); in create_ptd_atl()
883 else if (last_qtd_of_urb(qtd, qh)) in create_ptd_atl()
892 static void transform_add_int(struct isp1760_qh *qh, in transform_add_int() argument
944 static void create_ptd_int(struct isp1760_qh *qh, in create_ptd_int() argument
947 create_ptd_atl(qh, qtd, ptd); in create_ptd_int()
948 transform_add_int(qh, qtd, ptd); in create_ptd_int()
1003 struct isp1760_qtd *qtd, struct isp1760_qh *qh, in start_bus_transfer() argument
1013 WARN_ON(slots[slot].qh); in start_bus_transfer()
1035 qh->slot = slot; in start_bus_transfer()
1039 slots[slot].qh = qh; in start_bus_transfer()
1054 static void collect_qtds(struct usb_hcd *hcd, struct isp1760_qh *qh, in collect_qtds() argument
1061 list_for_each_entry_safe(qtd, qtd_next, &qh->qtd_list, qtd_list) { in collect_qtds()
1065 last_qtd = last_qtd_of_urb(qtd, qh); in collect_qtds()
1117 static void enqueue_qtds(struct usb_hcd *hcd, struct isp1760_qh *qh) in enqueue_qtds() argument
1129 if (unlikely(list_empty(&qh->qtd_list))) { in enqueue_qtds()
1135 if (qh->tt_buffer_dirty) in enqueue_qtds()
1138 if (usb_pipeint(list_entry(qh->qtd_list.next, struct isp1760_qtd, in enqueue_qtds()
1151 if (slots[curr_slot].qh == qh) in enqueue_qtds()
1156 list_for_each_entry(qtd, &qh->qtd_list, qtd_list) { in enqueue_qtds()
1181 create_ptd_int(qh, qtd, &ptd); in enqueue_qtds()
1183 create_ptd_atl(qh, qtd, &ptd); in enqueue_qtds()
1186 slots, qtd, qh, &ptd); in enqueue_qtds()
1200 struct isp1760_qh *qh, *qh_next; in schedule_ptds() local
1218 list_for_each_entry_safe(qh, qh_next, ep_queue, qh_list) { in schedule_ptds()
1219 collect_qtds(hcd, qh, &urb_list); in schedule_ptds()
1220 if (list_empty(&qh->qtd_list)) in schedule_ptds()
1221 list_del(&qh->qh_list); in schedule_ptds()
1257 list_for_each_entry_safe(qh, qh_next, ep_queue, qh_list) in schedule_ptds()
1258 enqueue_qtds(hcd, qh); in schedule_ptds()
1357 struct isp1760_qh *qh; in handle_done_ptds() local
1381 if (!slots[slot].qh) { in handle_done_ptds()
1396 if (!slots[slot].qh) { in handle_done_ptds()
1408 qh = slots[slot].qh; in handle_done_ptds()
1409 slots[slot].qh = NULL; in handle_done_ptds()
1410 qh->slot = -1; in handle_done_ptds()
1425 if (list_is_last(&qtd->qtd_list, &qh->qtd_list) || in handle_done_ptds()
1432 qh->toggle = FROM_DW3_DATA_TOGGLE(ptd.dw3); in handle_done_ptds()
1433 qh->ping = FROM_DW3_PING(ptd.dw3); in handle_done_ptds()
1444 qh->toggle = FROM_DW3_DATA_TOGGLE(ptd.dw3); in handle_done_ptds()
1445 qh->ping = FROM_DW3_PING(ptd.dw3); in handle_done_ptds()
1453 qh->tt_buffer_dirty = 1; in handle_done_ptds()
1457 qh->tt_buffer_dirty = 0; in handle_done_ptds()
1460 qh->toggle = 0; in handle_done_ptds()
1461 qh->ping = 0; in handle_done_ptds()
1476 create_ptd_int(qh, qtd, &ptd); in handle_done_ptds()
1479 create_ptd_atl(qh, qtd, &ptd); in handle_done_ptds()
1483 qh, &ptd); in handle_done_ptds()
1566 if (priv->atl_slots[slot].qh && time_after(jiffies, in errata2_function()
1886 struct isp1760_qh *qh, *qhit; in isp1760_urb_enqueue() local
1936 qh = urb->ep->hcpriv; in isp1760_urb_enqueue()
1937 if (qh) { in isp1760_urb_enqueue()
1940 if (qhit == qh) { in isp1760_urb_enqueue()
1946 list_add_tail(&qh->qh_list, ep_queue); in isp1760_urb_enqueue()
1948 qh = qh_alloc(GFP_ATOMIC); in isp1760_urb_enqueue()
1949 if (!qh) { in isp1760_urb_enqueue()
1955 list_add_tail(&qh->qh_list, ep_queue); in isp1760_urb_enqueue()
1956 urb->ep->hcpriv = qh; in isp1760_urb_enqueue()
1959 list_splice_tail(&new_qtds, &qh->qtd_list); in isp1760_urb_enqueue()
1968 struct isp1760_qh *qh) in kill_transfer() argument
1973 WARN_ON(qh->slot == -1); in kill_transfer()
1978 if (qh->slot != -1) { in kill_transfer()
1980 skip_map |= (1 << qh->slot); in kill_transfer()
1984 priv->atl_slots[qh->slot].qh = NULL; in kill_transfer()
1985 priv->atl_slots[qh->slot].qtd = NULL; in kill_transfer()
1987 if (qh->slot != -1) { in kill_transfer()
1989 skip_map |= (1 << qh->slot); in kill_transfer()
1992 priv->int_slots[qh->slot].qh = NULL; in kill_transfer()
1993 priv->int_slots[qh->slot].qtd = NULL; in kill_transfer()
1996 qh->slot = -1; in kill_transfer()
2003 static void dequeue_urb_from_qtd(struct usb_hcd *hcd, struct isp1760_qh *qh, in dequeue_urb_from_qtd() argument
2011 list_for_each_entry_from(qtd, &qh->qtd_list, qtd_list) { in dequeue_urb_from_qtd()
2017 if (last_qtd_of_urb(qtd, qh) && in dequeue_urb_from_qtd()
2022 kill_transfer(hcd, urb, qh); in dequeue_urb_from_qtd()
2027 qh->tt_buffer_dirty = 1; in dequeue_urb_from_qtd()
2030 qh->tt_buffer_dirty = 0; in dequeue_urb_from_qtd()
2039 struct isp1760_qh *qh; in isp1760_urb_dequeue() local
2048 qh = urb->ep->hcpriv; in isp1760_urb_dequeue()
2049 if (!qh) { in isp1760_urb_dequeue()
2054 list_for_each_entry(qtd, &qh->qtd_list, qtd_list) in isp1760_urb_dequeue()
2056 dequeue_urb_from_qtd(hcd, qh, qtd); in isp1760_urb_dequeue()
2057 list_move(&qtd->qtd_list, &qh->qtd_list); in isp1760_urb_dequeue()
2074 struct isp1760_qh *qh, *qh_iter; in isp1760_endpoint_disable() local
2079 qh = ep->hcpriv; in isp1760_endpoint_disable()
2080 if (!qh) in isp1760_endpoint_disable()
2083 WARN_ON(!list_empty(&qh->qtd_list)); in isp1760_endpoint_disable()
2087 if (qh_iter == qh) { in isp1760_endpoint_disable()
2092 qh_free(qh); in isp1760_endpoint_disable()
2492 struct isp1760_qh *qh = ep->hcpriv; in isp1760_clear_tt_buffer_complete() local
2495 if (!qh) in isp1760_clear_tt_buffer_complete()
2499 qh->tt_buffer_dirty = 0; in isp1760_clear_tt_buffer_complete()