Lines Matching refs:qtd
115 dbg_qtd(const char *label, struct fotg210_hcd *fotg210, struct fotg210_qtd *qtd) in dbg_qtd() argument
117 fotg210_dbg(fotg210, "%s td %p n%08x %08x t%08x p0=%08x\n", label, qtd, in dbg_qtd()
118 hc32_to_cpup(fotg210, &qtd->hw_next), in dbg_qtd()
119 hc32_to_cpup(fotg210, &qtd->hw_alt_next), in dbg_qtd()
120 hc32_to_cpup(fotg210, &qtd->hw_token), in dbg_qtd()
121 hc32_to_cpup(fotg210, &qtd->hw_buf[0])); in dbg_qtd()
122 if (qtd->hw_buf[1]) in dbg_qtd()
124 hc32_to_cpup(fotg210, &qtd->hw_buf[1]), in dbg_qtd()
125 hc32_to_cpup(fotg210, &qtd->hw_buf[2]), in dbg_qtd()
126 hc32_to_cpup(fotg210, &qtd->hw_buf[3]), in dbg_qtd()
127 hc32_to_cpup(fotg210, &qtd->hw_buf[4])); in dbg_qtd()
490 struct fotg210_qtd *qtd; in output_buf_tds_dir() local
495 list_for_each_entry(qtd, &qh->qtd_list, qtd_list) { in output_buf_tds_dir()
497 switch ((hc32_to_cpu(fotg210, qtd->hw_token) >> 8) & 0x03) { in output_buf_tds_dir()
1810 struct fotg210_qtd *qtd, dma_addr_t dma) in fotg210_qtd_init() argument
1812 memset(qtd, 0, sizeof(*qtd)); in fotg210_qtd_init()
1813 qtd->qtd_dma = dma; in fotg210_qtd_init()
1814 qtd->hw_token = cpu_to_hc32(fotg210, QTD_STS_HALT); in fotg210_qtd_init()
1815 qtd->hw_next = FOTG210_LIST_END(fotg210); in fotg210_qtd_init()
1816 qtd->hw_alt_next = FOTG210_LIST_END(fotg210); in fotg210_qtd_init()
1817 INIT_LIST_HEAD(&qtd->qtd_list); in fotg210_qtd_init()
1823 struct fotg210_qtd *qtd; in fotg210_qtd_alloc() local
1826 qtd = dma_pool_alloc(fotg210->qtd_pool, flags, &dma); in fotg210_qtd_alloc()
1827 if (qtd != NULL) in fotg210_qtd_alloc()
1828 fotg210_qtd_init(fotg210, qtd, dma); in fotg210_qtd_alloc()
1830 return qtd; in fotg210_qtd_alloc()
1834 struct fotg210_qtd *qtd) in fotg210_qtd_free() argument
1836 dma_pool_free(fotg210->qtd_pool, qtd, qtd->qtd_dma); in fotg210_qtd_free()
1995 static int qtd_fill(struct fotg210_hcd *fotg210, struct fotg210_qtd *qtd, in qtd_fill() argument
2002 qtd->hw_buf[0] = cpu_to_hc32(fotg210, (u32)addr); in qtd_fill()
2003 qtd->hw_buf_hi[0] = cpu_to_hc32(fotg210, (u32)(addr >> 32)); in qtd_fill()
2014 qtd->hw_buf[i] = cpu_to_hc32(fotg210, (u32)addr); in qtd_fill()
2015 qtd->hw_buf_hi[i] = cpu_to_hc32(fotg210, in qtd_fill()
2028 qtd->hw_token = cpu_to_hc32(fotg210, (count << 16) | token); in qtd_fill()
2029 qtd->length = count; in qtd_fill()
2035 struct fotg210_qh *qh, struct fotg210_qtd *qtd) in qh_update() argument
2042 hw->hw_qtd_next = QTD_NEXT(fotg210, qtd->qtd_dma); in qh_update()
2070 struct fotg210_qtd *qtd; in qh_refresh() local
2073 qtd = qh->dummy; in qh_refresh()
2075 qtd = list_entry(qh->qtd_list.next, in qh_refresh()
2084 if (cpu_to_hc32(fotg210, qtd->qtd_dma) == qh->hw->hw_current) { in qh_refresh()
2085 qh->hw->hw_qtd_next = qtd->hw_next; in qh_refresh()
2086 qtd = NULL; in qh_refresh()
2090 if (qtd) in qh_refresh()
2091 qh_update(fotg210, qh, qtd); in qh_refresh()
2248 struct fotg210_qtd *qtd, *tmp; in qh_completions() local
2282 list_for_each_entry_safe(qtd, tmp, &qh->qtd_list, qtd_list) { in qh_completions()
2286 urb = qtd->urb; in qh_completions()
2301 if (qtd == end) in qh_completions()
2306 token = hc32_to_cpu(fotg210, qtd->hw_token); in qh_completions()
2319 urb->transfer_buffer_length, qtd, qh); in qh_completions()
2335 qtd->length - QTD_LENGTH(token), in qh_completions()
2336 qtd->length, in qh_completions()
2347 qtd->hw_token = cpu_to_hc32(fotg210, in qh_completions()
2366 !(qtd->hw_alt_next & in qh_completions()
2392 cpu_to_hc32(fotg210, qtd->qtd_dma) in qh_completions()
2414 qtd->length, token); in qh_completions()
2416 (qtd->hw_alt_next & in qh_completions()
2443 if (stopped && qtd->qtd_list.prev != &qh->qtd_list) { in qh_completions()
2444 last = list_entry(qtd->qtd_list.prev, in qh_completions()
2446 last->hw_next = qtd->hw_next; in qh_completions()
2450 list_del(&qtd->qtd_list); in qh_completions()
2451 last = qtd; in qh_completions()
2525 struct fotg210_qtd *qtd, *temp; in qtd_list_free() local
2527 list_for_each_entry_safe(qtd, temp, head, qtd_list) { in qtd_list_free()
2528 list_del(&qtd->qtd_list); in qtd_list_free()
2529 fotg210_qtd_free(fotg210, qtd); in qtd_list_free()
2538 struct fotg210_qtd *qtd, *qtd_prev; in qh_urb_transaction() local
2549 qtd = fotg210_qtd_alloc(fotg210, flags); in qh_urb_transaction()
2550 if (unlikely(!qtd)) in qh_urb_transaction()
2552 list_add_tail(&qtd->qtd_list, head); in qh_urb_transaction()
2553 qtd->urb = urb; in qh_urb_transaction()
2563 qtd_fill(fotg210, qtd, urb->setup_dma, in qh_urb_transaction()
2569 qtd_prev = qtd; in qh_urb_transaction()
2570 qtd = fotg210_qtd_alloc(fotg210, flags); in qh_urb_transaction()
2571 if (unlikely(!qtd)) in qh_urb_transaction()
2573 qtd->urb = urb; in qh_urb_transaction()
2574 qtd_prev->hw_next = QTD_NEXT(fotg210, qtd->qtd_dma); in qh_urb_transaction()
2575 list_add_tail(&qtd->qtd_list, head); in qh_urb_transaction()
2614 this_qtd_len = qtd_fill(fotg210, qtd, buf, this_sg_len, token, in qh_urb_transaction()
2626 qtd->hw_alt_next = fotg210->async->hw->hw_alt_next; in qh_urb_transaction()
2640 qtd_prev = qtd; in qh_urb_transaction()
2641 qtd = fotg210_qtd_alloc(fotg210, flags); in qh_urb_transaction()
2642 if (unlikely(!qtd)) in qh_urb_transaction()
2644 qtd->urb = urb; in qh_urb_transaction()
2645 qtd_prev->hw_next = QTD_NEXT(fotg210, qtd->qtd_dma); in qh_urb_transaction()
2646 list_add_tail(&qtd->qtd_list, head); in qh_urb_transaction()
2656 qtd->hw_alt_next = FOTG210_LIST_END(fotg210); in qh_urb_transaction()
2676 qtd_prev = qtd; in qh_urb_transaction()
2677 qtd = fotg210_qtd_alloc(fotg210, flags); in qh_urb_transaction()
2678 if (unlikely(!qtd)) in qh_urb_transaction()
2680 qtd->urb = urb; in qh_urb_transaction()
2681 qtd_prev->hw_next = QTD_NEXT(fotg210, qtd->qtd_dma); in qh_urb_transaction()
2682 list_add_tail(&qtd->qtd_list, head); in qh_urb_transaction()
2685 qtd_fill(fotg210, qtd, 0, 0, token, 0); in qh_urb_transaction()
2691 qtd->hw_token |= cpu_to_hc32(fotg210, QTD_IOC); in qh_urb_transaction()
2961 struct fotg210_qtd *qtd; in qh_append_tds() local
2964 qtd = NULL; in qh_append_tds()
2966 qtd = list_entry(qtd_list->next, struct fotg210_qtd, in qh_append_tds()
2979 if (likely(qtd != NULL)) { in qh_append_tds()
2989 token = qtd->hw_token; in qh_append_tds()
2990 qtd->hw_token = HALT_BIT(fotg210); in qh_append_tds()
2995 *dummy = *qtd; in qh_append_tds()
2998 list_del(&qtd->qtd_list); in qh_append_tds()
3002 fotg210_qtd_init(fotg210, qtd, qtd->qtd_dma); in qh_append_tds()
3003 qh->dummy = qtd; in qh_append_tds()
3006 dma = qtd->qtd_dma; in qh_append_tds()
3007 qtd = list_entry(qh->qtd_list.prev, in qh_append_tds()
3009 qtd->hw_next = QTD_NEXT(fotg210, dma); in qh_append_tds()
3033 struct fotg210_qtd *qtd; in submit_async() local
3035 qtd = list_entry(qtd_list->next, struct fotg210_qtd, qtd_list); in submit_async()
3042 qtd, urb->ep->hcpriv); in submit_async()