Lines Matching defs:qtd

99 				    struct dwc2_qtd *qtd)
110 if (!qtd->urb)
113 usb_urb = qtd->urb->priv;
126 if (qtd->urb->status != -EPIPE && qtd->urb->status != -EREMOTEIO) {
438 struct dwc2_qtd *qtd,
454 length = qtd->ssplit_out_xfer_count;
485 * @qtd: Queue transfer descriptor
493 struct dwc2_qtd *qtd)
498 int xfer_length = dwc2_get_actual_xfer_length(hsotg, chan, chnum, qtd,
542 struct dwc2_qtd *qtd)
557 if (WARN(!qtd,
558 "qtd must be specified for control eps\n"))
562 qtd->data_toggle = DWC2_HC_PID_DATA0;
564 qtd->data_toggle = DWC2_HC_PID_DATA1;
579 * @qtd: Queue transfer descriptor
586 int chnum, struct dwc2_qtd *qtd,
590 struct dwc2_hcd_urb *urb = qtd->urb;
595 frame_desc = &urb->iso_descs[qtd->isoc_frame_index];
601 chan, chnum, qtd, halt_status, NULL);
620 chan, chnum, qtd, halt_status, NULL);
626 qtd->complete_split = 0;
627 qtd->isoc_split_offset = 0;
637 if (++qtd->isoc_frame_index == urb->packet_count) {
642 dwc2_host_complete(hsotg, qtd, 0);
662 struct dwc2_qtd *qtd;
673 qtd = list_first_entry(&qh->qtd_list, struct dwc2_qtd, qtd_list_entry);
675 if (qtd->complete_split)
677 else if (qtd->isoc_split_pos == DWC2_HCSPLT_XACTPOS_MID ||
678 qtd->isoc_split_pos == DWC2_HCSPLT_XACTPOS_END)
682 dwc2_hcd_qtd_unlink_and_free(hsotg, qtd, qh);
696 * @qtd: The QTD associated with the host channel. This QTD may be
706 struct dwc2_qtd *qtd,
727 if (qtd && qtd->error_count >= 3) {
731 dwc2_host_complete(hsotg, qtd, -EPROTO);
744 dwc2_host_complete(hsotg, qtd, -EIO);
804 struct dwc2_host_chan *chan, struct dwc2_qtd *qtd,
813 dwc2_release_channel(hsotg, chan, qtd, halt_status);
865 int chnum, struct dwc2_qtd *qtd,
870 qtd->error_count = 0;
898 dwc2_halt_channel(hsotg, chan, qtd, halt_status);
904 dwc2_release_channel(hsotg, chan, qtd, halt_status);
915 struct dwc2_qtd *qtd,
920 qtd->error_count = 0;
924 dwc2_release_channel(hsotg, chan, qtd, halt_status);
927 dwc2_halt_channel(hsotg, chan, qtd, halt_status);
932 struct dwc2_qtd *qtd)
939 if (!qtd->urb)
942 frame_desc = &qtd->urb->iso_descs[qtd->isoc_frame_index];
943 len = dwc2_get_actual_xfer_length(hsotg, chan, chnum, qtd,
945 if (!len && !qtd->isoc_split_offset) {
946 qtd->complete_split = 0;
956 memcpy(qtd->urb->buf + (chan->xfer_dma - qtd->urb->dma),
960 qtd->isoc_split_offset += len;
967 qtd->isoc_frame_index++;
968 qtd->complete_split = 0;
969 qtd->isoc_split_offset = 0;
972 if (qtd->isoc_frame_index == qtd->urb->packet_count) {
973 dwc2_host_complete(hsotg, qtd, 0);
974 dwc2_release_channel(hsotg, chan, qtd,
977 dwc2_release_channel(hsotg, chan, qtd,
990 struct dwc2_qtd *qtd)
992 struct dwc2_hcd_urb *urb = qtd->urb;
1019 if (qtd->complete_split &&
1021 qtd))
1024 qtd->complete_split = 0;
1031 switch (qtd->control_phase) {
1034 qtd->control_phase = DWC2_CONTROL_DATA;
1036 qtd->control_phase = DWC2_CONTROL_STATUS;
1043 chnum, urb, qtd);
1045 qtd->control_phase = DWC2_CONTROL_STATUS;
1050 qtd);
1058 dwc2_host_complete(hsotg, qtd, urb->status);
1063 dwc2_complete_non_periodic_xfer(hsotg, chan, chnum, qtd,
1069 qtd);
1071 dwc2_host_complete(hsotg, qtd, urb->status);
1077 dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
1078 dwc2_complete_non_periodic_xfer(hsotg, chan, chnum, qtd,
1084 qtd);
1091 dwc2_host_complete(hsotg, qtd, urb->status);
1097 dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
1098 dwc2_complete_periodic_xfer(hsotg, chan, chnum, qtd,
1104 if (qtd->isoc_split_pos == DWC2_HCSPLT_XACTPOS_ALL)
1106 chnum, qtd,
1108 dwc2_complete_periodic_xfer(hsotg, chan, chnum, qtd,
1123 struct dwc2_qtd *qtd)
1125 struct dwc2_hcd_urb *urb = qtd->urb;
1143 dwc2_host_complete(hsotg, qtd, -EPIPE);
1147 dwc2_host_complete(hsotg, qtd, -EPIPE);
1159 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_STALL);
1174 struct dwc2_qtd *qtd,
1178 qtd, halt_status, NULL);
1210 struct dwc2_qtd *qtd)
1212 if (!qtd) {
1213 dev_dbg(hsotg->dev, "%s: qtd is NULL\n", __func__);
1217 if (!qtd->urb) {
1218 dev_dbg(hsotg->dev, "%s: qtd->urb is NULL\n", __func__);
1247 qtd->error_count = 0;
1248 qtd->complete_split = 0;
1249 qtd->num_naks++;
1250 qtd->qh->want_wait = qtd->num_naks >= DWC2_NAKS_BEFORE_DELAY &&
1253 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_NAK);
1257 switch (dwc2_hcd_get_pipe_type(&qtd->urb->pipe_info)) {
1267 qtd->error_count = 0;
1276 qtd->error_count = 0;
1279 dwc2_update_urb_state_abn(hsotg, chan, chnum, qtd->urb,
1280 qtd, DWC2_HC_XFER_NAK);
1281 dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
1292 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_NAK);
1295 qtd->error_count = 0;
1296 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_NAK);
1315 struct dwc2_qtd *qtd)
1327 qtd->ssplit_out_xfer_count = chan->xfer_len;
1330 qtd->complete_split = 1;
1331 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_ACK);
1338 qtd->isoc_split_pos = DWC2_HCSPLT_XACTPOS_ALL;
1339 qtd->isoc_split_offset = 0;
1348 frame_desc = &qtd->urb->iso_descs[
1349 qtd->isoc_frame_index];
1350 qtd->isoc_split_offset += 188;
1352 if (frame_desc->length - qtd->isoc_split_offset
1354 qtd->isoc_split_pos =
1357 qtd->isoc_split_pos =
1363 qtd->error_count = 0;
1374 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_ACK);
1394 struct dwc2_qtd *qtd)
1407 qtd->complete_split = 0;
1408 qtd->isoc_split_offset = 0;
1409 qtd->isoc_frame_index++;
1410 if (qtd->urb &&
1411 qtd->isoc_frame_index == qtd->urb->packet_count) {
1412 dwc2_host_complete(hsotg, qtd, 0);
1413 dwc2_release_channel(hsotg, chan, qtd,
1416 dwc2_release_channel(hsotg, chan, qtd,
1481 qtd->error_count++;
1483 qtd->complete_split = 0;
1484 dwc2_halt_channel(hsotg, chan, qtd,
1491 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_NYET);
1496 qtd->error_count = 0;
1498 dwc2_update_urb_state_abn(hsotg, chan, chnum, qtd->urb, qtd,
1500 dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
1506 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_NYET);
1518 struct dwc2_qtd *qtd)
1523 dwc2_hc_handle_tt_clear(hsotg, chan, qtd);
1532 dwc2_host_complete(hsotg, qtd, -EOVERFLOW);
1533 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_BABBLE_ERR);
1538 qtd, DWC2_HC_XFER_BABBLE_ERR);
1539 dwc2_halt_channel(hsotg, chan, qtd, halt_status);
1552 struct dwc2_qtd *qtd)
1554 struct dwc2_hcd_urb *urb = qtd->urb;
1567 dwc2_hc_handle_tt_clear(hsotg, chan, qtd);
1637 dwc2_host_complete(hsotg, qtd, -EIO);
1656 struct dwc2_qtd *qtd)
1661 dwc2_hc_handle_tt_clear(hsotg, chan, qtd);
1669 switch (dwc2_hcd_get_pipe_type(&qtd->urb->pipe_info)) {
1672 qtd->error_count++;
1674 dwc2_update_urb_state_abn(hsotg, chan, chnum, qtd->urb,
1675 qtd, DWC2_HC_XFER_XACT_ERR);
1676 dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
1685 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_XACT_ERR);
1688 qtd->error_count++;
1690 qtd->complete_split = 0;
1691 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_XACT_ERR);
1698 chnum, qtd, DWC2_HC_XFER_XACT_ERR);
1699 dwc2_halt_channel(hsotg, chan, qtd, halt_status);
1714 struct dwc2_qtd *qtd)
1722 dwc2_hc_handle_tt_clear(hsotg, chan, qtd);
1724 switch (dwc2_hcd_get_pipe_type(&qtd->urb->pipe_info)) {
1729 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_FRAME_OVERRUN);
1733 qtd, DWC2_HC_XFER_FRAME_OVERRUN);
1734 dwc2_halt_channel(hsotg, chan, qtd, halt_status);
1747 struct dwc2_qtd *qtd)
1753 qtd->error_count = 0;
1759 dwc2_hc_handle_tt_clear(hsotg, chan, qtd);
1772 struct dwc2_qtd *qtd)
1798 if (qtd)
1799 dev_dbg(hsotg->dev, "qtd->complete_split %d\n",
1800 qtd->complete_split);
1818 dwc2_halt_channel(hsotg, chan, qtd, chan->halt_status);
1832 struct dwc2_qtd *qtd)
1867 dwc2_release_channel(hsotg, chan, qtd,
1883 dwc2_hc_ack_intr(hsotg, chan, chnum, qtd);
1884 dwc2_hc_xfercomp_intr(hsotg, chan, chnum, qtd);
1886 dwc2_hc_stall_intr(hsotg, chan, chnum, qtd);
1894 qtd->error_count = 0;
1906 dwc2_hc_xacterr_intr(hsotg, chan, chnum, qtd);
1909 dwc2_hc_xacterr_intr(hsotg, chan, chnum, qtd);
1912 dwc2_hc_ahberr_intr(hsotg, chan, chnum, qtd);
1914 dwc2_hc_babble_intr(hsotg, chan, chnum, qtd);
1916 dwc2_hc_frmovrun_intr(hsotg, chan, chnum, qtd);
1925 dwc2_hc_nyet_intr(hsotg, chan, chnum, qtd);
1935 dwc2_hc_nak_intr(hsotg, chan, chnum, qtd);
1945 dwc2_hc_ack_intr(hsotg, chan, chnum, qtd);
1958 dwc2_halt_channel(hsotg, chan, qtd,
1977 qtd->error_count++;
1978 dwc2_update_urb_state_abn(hsotg, chan, chnum, qtd->urb,
1979 qtd, DWC2_HC_XFER_XACT_ERR);
1990 if (qtd->urb->actual_length >= qtd->urb->length)
1991 qtd->error_count = 3;
1992 dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
1993 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_XACT_ERR);
2010 struct dwc2_qtd *qtd)
2017 dwc2_hc_chhltd_intr_dma(hsotg, chan, chnum, qtd);
2019 if (!dwc2_halt_status_ok(hsotg, chan, chnum, qtd))
2021 dwc2_release_channel(hsotg, chan, qtd, chan->halt_status);
2026 * Check if the given qtd is still the top of the list (and thus valid).
2029 * the qtd from the top of the list, this will return false (otherwise true).
2031 static bool dwc2_check_qtd_still_ok(struct dwc2_qtd *qtd, struct dwc2_qh *qh)
2040 return (cur_head == qtd);
2046 struct dwc2_qtd *qtd;
2082 * If the channel was halted due to a dequeue, the qtd list might
2083 * be empty or at least the first entry will not be the active qtd.
2117 qtd = list_first_entry(&chan->qh->qtd_list, struct dwc2_qtd,
2126 dwc2_hc_xfercomp_intr(hsotg, chan, chnum, qtd);
2136 dwc2_hc_chhltd_intr(hsotg, chan, chnum, qtd);
2137 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2141 dwc2_hc_ahberr_intr(hsotg, chan, chnum, qtd);
2142 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2146 dwc2_hc_stall_intr(hsotg, chan, chnum, qtd);
2147 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2151 dwc2_hc_nak_intr(hsotg, chan, chnum, qtd);
2152 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2156 dwc2_hc_ack_intr(hsotg, chan, chnum, qtd);
2157 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2161 dwc2_hc_nyet_intr(hsotg, chan, chnum, qtd);
2162 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2166 dwc2_hc_xacterr_intr(hsotg, chan, chnum, qtd);
2167 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2171 dwc2_hc_babble_intr(hsotg, chan, chnum, qtd);
2172 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2176 dwc2_hc_frmovrun_intr(hsotg, chan, chnum, qtd);
2177 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2181 dwc2_hc_datatglerr_intr(hsotg, chan, chnum, qtd);
2182 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))