Lines Matching refs:qtd
69 struct dwc2_qtd *qtd)
80 if (!qtd->urb)
83 usb_urb = qtd->urb->priv;
96 if (qtd->urb->status != -EPIPE && qtd->urb->status != -EREMOTEIO) {
408 struct dwc2_qtd *qtd,
424 length = qtd->ssplit_out_xfer_count;
455 * @qtd: Queue transfer descriptor
463 struct dwc2_qtd *qtd)
468 int xfer_length = dwc2_get_actual_xfer_length(hsotg, chan, chnum, qtd,
512 struct dwc2_qtd *qtd)
527 if (WARN(!qtd,
528 "qtd must be specified for control eps\n"))
532 qtd->data_toggle = DWC2_HC_PID_DATA0;
534 qtd->data_toggle = DWC2_HC_PID_DATA1;
549 * @qtd: Queue transfer descriptor
556 int chnum, struct dwc2_qtd *qtd,
560 struct dwc2_hcd_urb *urb = qtd->urb;
565 frame_desc = &urb->iso_descs[qtd->isoc_frame_index];
571 chan, chnum, qtd, halt_status, NULL);
590 chan, chnum, qtd, halt_status, NULL);
596 qtd->complete_split = 0;
597 qtd->isoc_split_offset = 0;
607 if (++qtd->isoc_frame_index == urb->packet_count) {
612 dwc2_host_complete(hsotg, qtd, 0);
632 struct dwc2_qtd *qtd;
643 qtd = list_first_entry(&qh->qtd_list, struct dwc2_qtd, qtd_list_entry);
645 if (qtd->complete_split)
647 else if (qtd->isoc_split_pos == DWC2_HCSPLT_XACTPOS_MID ||
648 qtd->isoc_split_pos == DWC2_HCSPLT_XACTPOS_END)
652 dwc2_hcd_qtd_unlink_and_free(hsotg, qtd, qh);
666 * @qtd: The QTD associated with the host channel. This QTD may be
676 struct dwc2_qtd *qtd,
697 if (qtd && qtd->error_count >= 3) {
701 dwc2_host_complete(hsotg, qtd, -EPROTO);
714 dwc2_host_complete(hsotg, qtd, -EIO);
774 struct dwc2_host_chan *chan, struct dwc2_qtd *qtd,
783 dwc2_release_channel(hsotg, chan, qtd, halt_status);
835 int chnum, struct dwc2_qtd *qtd,
840 qtd->error_count = 0;
868 dwc2_halt_channel(hsotg, chan, qtd, halt_status);
874 dwc2_release_channel(hsotg, chan, qtd, halt_status);
885 struct dwc2_qtd *qtd,
890 qtd->error_count = 0;
894 dwc2_release_channel(hsotg, chan, qtd, halt_status);
897 dwc2_halt_channel(hsotg, chan, qtd, halt_status);
902 struct dwc2_qtd *qtd)
909 if (!qtd->urb)
912 frame_desc = &qtd->urb->iso_descs[qtd->isoc_frame_index];
913 len = dwc2_get_actual_xfer_length(hsotg, chan, chnum, qtd,
915 if (!len && !qtd->isoc_split_offset) {
916 qtd->complete_split = 0;
926 memcpy(qtd->urb->buf + (chan->xfer_dma - qtd->urb->dma),
930 qtd->isoc_split_offset += len;
937 qtd->isoc_frame_index++;
938 qtd->complete_split = 0;
939 qtd->isoc_split_offset = 0;
942 if (qtd->isoc_frame_index == qtd->urb->packet_count) {
943 dwc2_host_complete(hsotg, qtd, 0);
944 dwc2_release_channel(hsotg, chan, qtd,
947 dwc2_release_channel(hsotg, chan, qtd,
960 struct dwc2_qtd *qtd)
962 struct dwc2_hcd_urb *urb = qtd->urb;
989 if (qtd->complete_split &&
991 qtd))
994 qtd->complete_split = 0;
1001 switch (qtd->control_phase) {
1004 qtd->control_phase = DWC2_CONTROL_DATA;
1006 qtd->control_phase = DWC2_CONTROL_STATUS;
1013 chnum, urb, qtd);
1015 qtd->control_phase = DWC2_CONTROL_STATUS;
1020 qtd);
1028 dwc2_host_complete(hsotg, qtd, urb->status);
1033 dwc2_complete_non_periodic_xfer(hsotg, chan, chnum, qtd,
1039 qtd);
1041 dwc2_host_complete(hsotg, qtd, urb->status);
1047 dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
1048 dwc2_complete_non_periodic_xfer(hsotg, chan, chnum, qtd,
1054 qtd);
1061 dwc2_host_complete(hsotg, qtd, urb->status);
1067 dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
1068 dwc2_complete_periodic_xfer(hsotg, chan, chnum, qtd,
1074 if (qtd->isoc_split_pos == DWC2_HCSPLT_XACTPOS_ALL)
1076 chnum, qtd,
1078 dwc2_complete_periodic_xfer(hsotg, chan, chnum, qtd,
1093 struct dwc2_qtd *qtd)
1095 struct dwc2_hcd_urb *urb = qtd->urb;
1113 dwc2_host_complete(hsotg, qtd, -EPIPE);
1117 dwc2_host_complete(hsotg, qtd, -EPIPE);
1129 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_STALL);
1144 struct dwc2_qtd *qtd,
1148 qtd, halt_status, NULL);
1180 struct dwc2_qtd *qtd)
1182 if (!qtd) {
1183 dev_dbg(hsotg->dev, "%s: qtd is NULL\n", __func__);
1187 if (!qtd->urb) {
1188 dev_dbg(hsotg->dev, "%s: qtd->urb is NULL\n", __func__);
1217 qtd->error_count = 0;
1218 qtd->complete_split = 0;
1219 qtd->num_naks++;
1220 qtd->qh->want_wait = qtd->num_naks >= DWC2_NAKS_BEFORE_DELAY &&
1223 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_NAK);
1227 switch (dwc2_hcd_get_pipe_type(&qtd->urb->pipe_info)) {
1237 qtd->error_count = 0;
1246 qtd->error_count = 0;
1249 dwc2_update_urb_state_abn(hsotg, chan, chnum, qtd->urb,
1250 qtd, DWC2_HC_XFER_NAK);
1251 dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
1262 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_NAK);
1265 qtd->error_count = 0;
1266 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_NAK);
1285 struct dwc2_qtd *qtd)
1297 qtd->ssplit_out_xfer_count = chan->xfer_len;
1300 qtd->complete_split = 1;
1301 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_ACK);
1308 qtd->isoc_split_pos = DWC2_HCSPLT_XACTPOS_ALL;
1309 qtd->isoc_split_offset = 0;
1318 frame_desc = &qtd->urb->iso_descs[
1319 qtd->isoc_frame_index];
1320 qtd->isoc_split_offset += 188;
1322 if (frame_desc->length - qtd->isoc_split_offset
1324 qtd->isoc_split_pos =
1327 qtd->isoc_split_pos =
1333 qtd->error_count = 0;
1344 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_ACK);
1364 struct dwc2_qtd *qtd)
1377 qtd->complete_split = 0;
1378 qtd->isoc_split_offset = 0;
1379 qtd->isoc_frame_index++;
1380 if (qtd->urb &&
1381 qtd->isoc_frame_index == qtd->urb->packet_count) {
1382 dwc2_host_complete(hsotg, qtd, 0);
1383 dwc2_release_channel(hsotg, chan, qtd,
1386 dwc2_release_channel(hsotg, chan, qtd,
1451 qtd->error_count++;
1453 qtd->complete_split = 0;
1454 dwc2_halt_channel(hsotg, chan, qtd,
1461 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_NYET);
1466 qtd->error_count = 0;
1468 dwc2_update_urb_state_abn(hsotg, chan, chnum, qtd->urb, qtd,
1470 dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
1476 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_NYET);
1488 struct dwc2_qtd *qtd)
1493 dwc2_hc_handle_tt_clear(hsotg, chan, qtd);
1502 dwc2_host_complete(hsotg, qtd, -EOVERFLOW);
1503 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_BABBLE_ERR);
1508 qtd, DWC2_HC_XFER_BABBLE_ERR);
1509 dwc2_halt_channel(hsotg, chan, qtd, halt_status);
1522 struct dwc2_qtd *qtd)
1524 struct dwc2_hcd_urb *urb = qtd->urb;
1537 dwc2_hc_handle_tt_clear(hsotg, chan, qtd);
1607 dwc2_host_complete(hsotg, qtd, -EIO);
1626 struct dwc2_qtd *qtd)
1631 dwc2_hc_handle_tt_clear(hsotg, chan, qtd);
1639 switch (dwc2_hcd_get_pipe_type(&qtd->urb->pipe_info)) {
1642 qtd->error_count++;
1644 dwc2_update_urb_state_abn(hsotg, chan, chnum, qtd->urb,
1645 qtd, DWC2_HC_XFER_XACT_ERR);
1646 dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
1655 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_XACT_ERR);
1658 qtd->error_count++;
1660 qtd->complete_split = 0;
1661 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_XACT_ERR);
1668 chnum, qtd, DWC2_HC_XFER_XACT_ERR);
1669 dwc2_halt_channel(hsotg, chan, qtd, halt_status);
1684 struct dwc2_qtd *qtd)
1692 dwc2_hc_handle_tt_clear(hsotg, chan, qtd);
1694 switch (dwc2_hcd_get_pipe_type(&qtd->urb->pipe_info)) {
1699 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_FRAME_OVERRUN);
1703 qtd, DWC2_HC_XFER_FRAME_OVERRUN);
1704 dwc2_halt_channel(hsotg, chan, qtd, halt_status);
1717 struct dwc2_qtd *qtd)
1723 qtd->error_count = 0;
1729 dwc2_hc_handle_tt_clear(hsotg, chan, qtd);
1742 struct dwc2_qtd *qtd)
1768 if (qtd)
1769 dev_dbg(hsotg->dev, "qtd->complete_split %d\n",
1770 qtd->complete_split);
1788 dwc2_halt_channel(hsotg, chan, qtd, chan->halt_status);
1802 struct dwc2_qtd *qtd)
1837 dwc2_release_channel(hsotg, chan, qtd,
1853 dwc2_hc_ack_intr(hsotg, chan, chnum, qtd);
1854 dwc2_hc_xfercomp_intr(hsotg, chan, chnum, qtd);
1856 dwc2_hc_stall_intr(hsotg, chan, chnum, qtd);
1864 qtd->error_count = 0;
1876 dwc2_hc_xacterr_intr(hsotg, chan, chnum, qtd);
1879 dwc2_hc_xacterr_intr(hsotg, chan, chnum, qtd);
1882 dwc2_hc_ahberr_intr(hsotg, chan, chnum, qtd);
1884 dwc2_hc_babble_intr(hsotg, chan, chnum, qtd);
1886 dwc2_hc_frmovrun_intr(hsotg, chan, chnum, qtd);
1895 dwc2_hc_nyet_intr(hsotg, chan, chnum, qtd);
1905 dwc2_hc_nak_intr(hsotg, chan, chnum, qtd);
1915 dwc2_hc_ack_intr(hsotg, chan, chnum, qtd);
1928 dwc2_halt_channel(hsotg, chan, qtd,
1947 qtd->error_count++;
1948 dwc2_update_urb_state_abn(hsotg, chan, chnum, qtd->urb,
1949 qtd, DWC2_HC_XFER_XACT_ERR);
1960 if (qtd->urb->actual_length >= qtd->urb->length)
1961 qtd->error_count = 3;
1962 dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
1963 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_XACT_ERR);
1980 struct dwc2_qtd *qtd)
1987 dwc2_hc_chhltd_intr_dma(hsotg, chan, chnum, qtd);
1989 if (!dwc2_halt_status_ok(hsotg, chan, chnum, qtd))
1991 dwc2_release_channel(hsotg, chan, qtd, chan->halt_status);
1996 * Check if the given qtd is still the top of the list (and thus valid).
1999 * the qtd from the top of the list, this will return false (otherwise true).
2001 static bool dwc2_check_qtd_still_ok(struct dwc2_qtd *qtd, struct dwc2_qh *qh)
2010 return (cur_head == qtd);
2016 struct dwc2_qtd *qtd;
2052 * If the channel was halted due to a dequeue, the qtd list might
2053 * be empty or at least the first entry will not be the active qtd.
2087 qtd = list_first_entry(&chan->qh->qtd_list, struct dwc2_qtd,
2096 dwc2_hc_xfercomp_intr(hsotg, chan, chnum, qtd);
2106 dwc2_hc_chhltd_intr(hsotg, chan, chnum, qtd);
2107 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2111 dwc2_hc_ahberr_intr(hsotg, chan, chnum, qtd);
2112 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2116 dwc2_hc_stall_intr(hsotg, chan, chnum, qtd);
2117 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2121 dwc2_hc_nak_intr(hsotg, chan, chnum, qtd);
2122 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2126 dwc2_hc_ack_intr(hsotg, chan, chnum, qtd);
2127 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2131 dwc2_hc_nyet_intr(hsotg, chan, chnum, qtd);
2132 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2136 dwc2_hc_xacterr_intr(hsotg, chan, chnum, qtd);
2137 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2141 dwc2_hc_babble_intr(hsotg, chan, chnum, qtd);
2142 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2146 dwc2_hc_frmovrun_intr(hsotg, chan, chnum, qtd);
2147 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2151 dwc2_hc_datatglerr_intr(hsotg, chan, chnum, qtd);
2152 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))