Lines Matching defs:qtd
50 #define FOTG210_TUNE_CERR 3 /* 0-3 qtd retries; 0 == don't stop */
116 dbg_qtd(const char *label, struct fotg210_hcd *fotg210, struct fotg210_qtd *qtd)
118 fotg210_dbg(fotg210, "%s td %p n%08x %08x t%08x p0=%08x\n", label, qtd,
119 hc32_to_cpup(fotg210, &qtd->hw_next),
120 hc32_to_cpup(fotg210, &qtd->hw_alt_next),
121 hc32_to_cpup(fotg210, &qtd->hw_token),
122 hc32_to_cpup(fotg210, &qtd->hw_buf[0]));
123 if (qtd->hw_buf[1])
125 hc32_to_cpup(fotg210, &qtd->hw_buf[1]),
126 hc32_to_cpup(fotg210, &qtd->hw_buf[2]),
127 hc32_to_cpup(fotg210, &qtd->hw_buf[3]),
128 hc32_to_cpup(fotg210, &qtd->hw_buf[4]));
136 fotg210_dbg(fotg210, "%s qh %p n%08x info %x %x qtd %x\n", label, qh,
377 /* else alt_next points to some other qtd */
488 struct fotg210_qtd *qtd;
493 list_for_each_entry(qtd, &qh->qtd_list, qtd_list) {
495 switch ((hc32_to_cpu(fotg210, qtd->hw_token) >> 8) & 0x03) {
1805 struct fotg210_qtd *qtd, dma_addr_t dma)
1807 memset(qtd, 0, sizeof(*qtd));
1808 qtd->qtd_dma = dma;
1809 qtd->hw_token = cpu_to_hc32(fotg210, QTD_STS_HALT);
1810 qtd->hw_next = FOTG210_LIST_END(fotg210);
1811 qtd->hw_alt_next = FOTG210_LIST_END(fotg210);
1812 INIT_LIST_HEAD(&qtd->qtd_list);
1818 struct fotg210_qtd *qtd;
1821 qtd = dma_pool_alloc(fotg210->qtd_pool, flags, &dma);
1822 if (qtd != NULL)
1823 fotg210_qtd_init(fotg210, qtd, dma);
1825 return qtd;
1829 struct fotg210_qtd *qtd)
1831 dma_pool_free(fotg210->qtd_pool, qtd, qtd->qtd_dma);
1974 * Control, bulk, and interrupt traffic all use "qh" lists. They list "qtd"
1989 /* fill a qtd, returning how much of the buffer we were able to queue up */
1990 static int qtd_fill(struct fotg210_hcd *fotg210, struct fotg210_qtd *qtd,
1997 qtd->hw_buf[0] = cpu_to_hc32(fotg210, (u32)addr);
1998 qtd->hw_buf_hi[0] = cpu_to_hc32(fotg210, (u32)(addr >> 32));
2006 /* per-qtd limit: from 16K to 20K (best alignment) */
2009 qtd->hw_buf[i] = cpu_to_hc32(fotg210, (u32)addr);
2010 qtd->hw_buf_hi[i] = cpu_to_hc32(fotg210,
2023 qtd->hw_token = cpu_to_hc32(fotg210, (count << 16) | token);
2024 qtd->length = count;
2030 struct fotg210_qh *qh, struct fotg210_qtd *qtd)
2037 hw->hw_qtd_next = QTD_NEXT(fotg210, qtd->qtd_dma);
2065 struct fotg210_qtd *qtd;
2068 qtd = qh->dummy;
2070 qtd = list_entry(qh->qtd_list.next,
2073 * first qtd may already be partially processed.
2075 * might have reference to the just unlinked qtd. The
2076 * qtd is updated in qh_completions(). Update the QH
2079 if (cpu_to_hc32(fotg210, qtd->qtd_dma) == qh->hw->hw_current) {
2080 qh->hw->hw_qtd_next = qtd->hw_next;
2081 qtd = NULL;
2085 if (qtd)
2086 qh_update(fotg210, qh, qtd);
2181 "dev%d ep%d%s qtd token %08x --> status %d\n",
2243 struct fotg210_qtd *qtd, *tmp;
2277 list_for_each_entry_safe(qtd, tmp, &qh->qtd_list, qtd_list) {
2281 urb = qtd->urb;
2296 if (qtd == end)
2299 /* hardware copies qtd out of qh overlay */
2301 token = hc32_to_cpu(fotg210, qtd->hw_token);
2310 "detected DataBufferErr for urb %p ep%d%s len %d, qtd %p [qh %p]\n",
2314 urb->transfer_buffer_length, qtd, qh);
2330 qtd->length - QTD_LENGTH(token),
2331 qtd->length,
2334 /* reset the token in the qtd and the
2336 * the qtd) so that we pick up from
2342 qtd->hw_token = cpu_to_hc32(fotg210,
2356 * most other single-qtd reads ... the queue stops if
2361 !(qtd->hw_alt_next &
2379 /* this qtd is active; skip it unless a previous qtd
2387 cpu_to_hc32(fotg210, qtd->qtd_dma)
2400 /* unless we already know the urb's status, collect qtd status
2402 * cases with only one data qtd (including control transfers),
2404 * example, with a 32 KB transfer), when the first qtd gets a
2409 qtd->length, token);
2411 (qtd->hw_alt_next &
2438 if (stopped && qtd->qtd_list.prev != &qh->qtd_list) {
2439 last = list_entry(qtd->qtd_list.prev,
2441 last->hw_next = qtd->hw_next;
2444 /* remove qtd; it's recycled after possible urb completion */
2445 list_del(&qtd->qtd_list);
2446 last = qtd;
2448 /* reinit the xacterr counter for the next qtd */
2479 * overlaying the dummy qtd (which reduces DMA chatter).
2515 struct fotg210_qtd *qtd, *temp;
2517 list_for_each_entry_safe(qtd, temp, head, qtd_list) {
2518 list_del(&qtd->qtd_list);
2519 fotg210_qtd_free(fotg210, qtd);
2528 struct fotg210_qtd *qtd, *qtd_prev;
2539 qtd = fotg210_qtd_alloc(fotg210, flags);
2540 if (unlikely(!qtd))
2542 list_add_tail(&qtd->qtd_list, head);
2543 qtd->urb = urb;
2553 qtd_fill(fotg210, qtd, urb->setup_dma,
2559 qtd_prev = qtd;
2560 qtd = fotg210_qtd_alloc(fotg210, flags);
2561 if (unlikely(!qtd))
2563 qtd->urb = urb;
2564 qtd_prev->hw_next = QTD_NEXT(fotg210, qtd->qtd_dma);
2565 list_add_tail(&qtd->qtd_list, head);
2604 this_qtd_len = qtd_fill(fotg210, qtd, buf, this_sg_len, token,
2612 * qtd ... that forces the queue to stop, for manual cleanup.
2616 qtd->hw_alt_next = fotg210->async->hw->hw_alt_next;
2618 /* qh makes control packets use qtd toggle; maybe switch it */
2630 qtd_prev = qtd;
2631 qtd = fotg210_qtd_alloc(fotg210, flags);
2632 if (unlikely(!qtd))
2634 qtd->urb = urb;
2635 qtd_prev->hw_next = QTD_NEXT(fotg210, qtd->qtd_dma);
2636 list_add_tail(&qtd->qtd_list, head);
2642 * last data qtd (the only one, for control and most other cases).
2646 qtd->hw_alt_next = FOTG210_LIST_END(fotg210);
2666 qtd_prev = qtd;
2667 qtd = fotg210_qtd_alloc(fotg210, flags);
2668 if (unlikely(!qtd))
2670 qtd->urb = urb;
2671 qtd_prev->hw_next = QTD_NEXT(fotg210, qtd->qtd_dma);
2672 list_add_tail(&qtd->qtd_list, head);
2675 qtd_fill(fotg210, qtd, 0, 0, token, 0);
2681 qtd->hw_token |= cpu_to_hc32(fotg210, QTD_IOC);
2697 /* Each QH holds a qtd list; a QH is used for everything except iso.
2810 info1 |= QH_TOGGLE_CTL; /* toggle from qtd */
2839 info1 |= QH_TOGGLE_CTL; /* toggle from qtd */
2929 /* qtd completions reported later by interrupt */
2953 struct fotg210_qtd *qtd;
2956 qtd = NULL;
2958 qtd = list_entry(qtd_list->next, struct fotg210_qtd,
2968 /* just one way to queue requests: swap with the dummy qtd.
2971 if (likely(qtd != NULL)) {
2981 token = qtd->hw_token;
2982 qtd->hw_token = HALT_BIT(fotg210);
2987 *dummy = *qtd;
2990 list_del(&qtd->qtd_list);
2994 fotg210_qtd_init(fotg210, qtd, qtd->qtd_dma);
2995 qh->dummy = qtd;
2998 dma = qtd->qtd_dma;
2999 qtd = list_entry(qh->qtd_list.prev,
3001 qtd->hw_next = QTD_NEXT(fotg210, dma);
3025 struct fotg210_qtd *qtd;
3027 qtd = list_entry(qtd_list->next, struct fotg210_qtd, qtd_list);
3029 "%s %s urb %p ep%d%s len %d, qtd %p [qh %p]\n",
3034 qtd, urb->ep->hcpriv);
5702 pr_debug("%s: block sizes: qh %zd qtd %zd itd %zd\n",