Home | History | Annotate | Download | only in dist

Lines Matching defs:qtd

106 				    struct dwc2_qtd *qtd)
116 if (!qtd->urb)
120 if (qtd->urb->status != -EPIPE && qtd->urb->status != -EREMOTEIO) {
433 struct dwc2_qtd *qtd,
449 length = qtd->ssplit_out_xfer_count;
482 struct dwc2_qtd *qtd)
486 int xfer_length = dwc2_get_actual_xfer_length(hsotg, chan, chnum, qtd,
538 * saved in the QH for non-control transfers and it's saved in the QTD for
543 struct dwc2_qtd *qtd)
555 qtd->data_toggle = DWC2_HC_PID_DATA0;
557 qtd->data_toggle = DWC2_HC_PID_DATA1;
573 int chnum, struct dwc2_qtd *qtd,
577 struct dwc2_hcd_urb *urb = qtd->urb;
583 frame_desc = &urb->iso_descs[qtd->isoc_frame_index];
589 chan, chnum, qtd, halt_status, NULL);
602 qtd->isoc_split_offset,
612 if (qtd->isoc_split_pos != DWC2_HCSPLT_XACTPOS_ALL)
633 chan, chnum, qtd, halt_status, NULL);
646 qtd->isoc_split_offset,
658 qtd->complete_split = 0;
659 qtd->isoc_split_offset = 0;
669 if (++qtd->isoc_frame_index == urb->packet_count) {
674 dwc2_host_complete(hsotg, qtd, 0);
684 * Frees the first QTD in the QH's list if free_qtd is 1. For non-periodic
694 struct dwc2_qtd *qtd;
701 dev_dbg(hsotg->dev, "## QTD list empty ##\n");
705 qtd = list_first_entry(&qh->qtd_list, struct dwc2_qtd, qtd_list_entry);
707 if (qtd->complete_split)
709 else if (qtd->isoc_split_pos == DWC2_HCSPLT_XACTPOS_MID ||
710 qtd->isoc_split_pos == DWC2_HCSPLT_XACTPOS_END)
714 dwc2_hcd_qtd_unlink_and_free(hsotg, qtd, qh);
730 * @qtd: The QTD associated with the host channel. This QTD may be
740 struct dwc2_qtd *qtd,
761 if (qtd && qtd->error_count >= 3) {
765 dwc2_host_complete(hsotg, qtd, -EPROTO);
770 * The QTD has already been removed and the QH has been
778 dwc2_host_complete(hsotg, qtd, -EIO);
838 struct dwc2_host_chan *chan, struct dwc2_qtd *qtd,
847 dwc2_release_channel(hsotg, chan, qtd, halt_status);
899 int chnum, struct dwc2_qtd *qtd,
904 qtd->error_count = 0;
932 dwc2_halt_channel(hsotg, chan, qtd, halt_status);
938 dwc2_release_channel(hsotg, chan, qtd, halt_status);
949 struct dwc2_qtd *qtd,
954 qtd->error_count = 0;
958 dwc2_release_channel(hsotg, chan, qtd, halt_status);
961 dwc2_halt_channel(hsotg, chan, qtd, halt_status);
966 struct dwc2_qtd *qtd)
971 if (!qtd->urb)
974 frame_desc = &qtd->urb->iso_descs[qtd->isoc_frame_index];
975 len = dwc2_get_actual_xfer_length(hsotg, chan, chnum, qtd,
978 qtd->complete_split = 0;
979 qtd->isoc_split_offset = 0;
987 usb_syncmem(qtd->urb->usbdma, chan->qh->dw_align_buf_dma,
989 memcpy(qtd->urb->buf + frame_desc->offset +
990 qtd->isoc_split_offset, chan->qh->dw_align_buf, len);
991 usb_syncmem(qtd->urb->usbdma, chan->qh->dw_align_buf_dma,
995 qtd->isoc_split_offset += len;
999 qtd->isoc_frame_index++;
1000 qtd->complete_split = 0;
1001 qtd->isoc_split_offset = 0;
1004 if (qtd->isoc_frame_index == qtd->urb->packet_count) {
1005 dwc2_host_complete(hsotg, qtd, 0);
1006 dwc2_release_channel(hsotg, chan, qtd,
1009 dwc2_release_channel(hsotg, chan, qtd,
1022 struct dwc2_qtd *qtd)
1024 struct dwc2_hcd_urb *urb = qtd->urb;
1051 if (qtd->complete_split &&
1053 qtd))
1056 qtd->complete_split = 0;
1060 /* Update the QTD and URB states */
1063 switch (qtd->control_phase) {
1066 qtd->control_phase = DWC2_CONTROL_DATA;
1068 qtd->control_phase = DWC2_CONTROL_STATUS;
1075 chnum, urb, qtd);
1077 qtd->control_phase = DWC2_CONTROL_STATUS;
1082 qtd);
1090 dwc2_host_complete(hsotg, qtd, urb->status);
1095 dwc2_complete_non_periodic_xfer(hsotg, chan, chnum, qtd,
1101 qtd);
1103 dwc2_host_complete(hsotg, qtd, urb->status);
1109 dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
1110 dwc2_complete_non_periodic_xfer(hsotg, chan, chnum, qtd,
1116 qtd);
1123 dwc2_host_complete(hsotg, qtd, urb->status);
1129 dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
1130 dwc2_complete_periodic_xfer(hsotg, chan, chnum, qtd,
1137 chnum, qtd, DWC2_HC_XFER_COMPLETE);
1138 dwc2_complete_periodic_xfer(hsotg, chan, chnum, qtd,
1153 struct dwc2_qtd *qtd)
1155 struct dwc2_hcd_urb *urb = qtd->urb;
1173 dwc2_host_complete(hsotg, qtd, -EPIPE);
1177 dwc2_host_complete(hsotg, qtd, -EPIPE);
1189 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_STALL);
1204 struct dwc2_qtd *qtd,
1208 qtd, halt_status, NULL);
1256 struct dwc2_qtd *qtd)
1258 if (!qtd) {
1259 dev_dbg(hsotg->dev, "%s: qtd is NULL\n", __func__);
1263 if (!qtd->urb) {
1264 dev_dbg(hsotg->dev, "%s: qtd->urb is NULL\n", __func__);
1291 switch (dwc2_hcd_get_pipe_type(&qtd->urb->pipe_info)) {
1299 qtd->error_count = 0;
1300 qtd->complete_split = 0;
1301 qtd->num_naks++;
1302 qtd->qh->want_wait = qtd->num_naks >= dwc2_naks_before_delay;
1303 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_NAK);
1307 switch (dwc2_hcd_get_pipe_type(&qtd->urb->pipe_info)) {
1317 qtd->error_count = 0;
1326 qtd->error_count = 0;
1332 qtd->num_naks++;
1333 qtd->qh->want_wait = qtd->num_naks >= dwc2_out_naks_before_delay;
1336 dwc2_update_urb_state_abn(hsotg, chan, chnum, qtd->urb,
1337 qtd, DWC2_HC_XFER_NAK);
1338 dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
1349 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_NAK);
1352 qtd->error_count = 0;
1353 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_NAK);
1372 struct dwc2_qtd *qtd)
1384 qtd->ssplit_out_xfer_count = chan->xfer_len;
1387 qtd->complete_split = 1;
1388 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_ACK);
1395 qtd->isoc_split_pos = DWC2_HCSPLT_XACTPOS_ALL;
1396 qtd->isoc_split_offset = 0;
1405 frame_desc = &qtd->urb->iso_descs[
1406 qtd->isoc_frame_index];
1407 qtd->isoc_split_offset += 188;
1409 if (frame_desc->length - qtd->isoc_split_offset
1411 qtd->isoc_split_pos =
1414 qtd->isoc_split_pos =
1420 qtd->error_count = 0;
1431 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_ACK);
1451 struct dwc2_qtd *qtd)
1464 qtd->complete_split = 0;
1465 qtd->isoc_split_offset = 0;
1466 qtd->isoc_frame_index++;
1467 if (qtd->urb &&
1468 qtd->isoc_frame_index == qtd->urb->packet_count) {
1469 dwc2_host_complete(hsotg, qtd, 0);
1470 dwc2_release_channel(hsotg, chan, qtd,
1473 dwc2_release_channel(hsotg, chan, qtd,
1497 qtd->error_count++;
1499 qtd->complete_split = 0;
1500 dwc2_halt_channel(hsotg, chan, qtd,
1507 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_NYET);
1512 qtd->error_count = 0;
1514 dwc2_update_urb_state_abn(hsotg, chan, chnum, qtd->urb, qtd,
1516 dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
1522 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_NYET);
1534 struct dwc2_qtd *qtd)
1539 // dwc2_hc_handle_tt_clear(hsotg, chan, qtd);
1548 dwc2_host_complete(hsotg, qtd, -EOVERFLOW);
1549 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_BABBLE_ERR);
1554 qtd, DWC2_HC_XFER_BABBLE_ERR);
1555 dwc2_halt_channel(hsotg, chan, qtd, halt_status);
1568 struct dwc2_qtd *qtd)
1570 struct dwc2_hcd_urb *urb = qtd->urb;
1578 // dwc2_hc_handle_tt_clear(hsotg, chan, qtd);
1651 dwc2_host_complete(hsotg, qtd, -EIO);
1670 struct dwc2_qtd *qtd)
1675 // dwc2_hc_handle_tt_clear(hsotg, chan, qtd);
1683 switch (dwc2_hcd_get_pipe_type(&qtd->urb->pipe_info)) {
1686 qtd->error_count++;
1689 dwc2_update_urb_state_abn(hsotg, chan, chnum, qtd->urb,
1690 qtd, DWC2_HC_XFER_XACT_ERR);
1691 dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
1700 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_XACT_ERR);
1703 qtd->error_count++;
1705 qtd->complete_split = 0;
1706 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_XACT_ERR);
1713 chnum, qtd, DWC2_HC_XFER_XACT_ERR);
1714 dwc2_halt_channel(hsotg, chan, qtd, halt_status);
1729 struct dwc2_qtd *qtd)
1737 dwc2_hc_handle_tt_clear(hsotg, chan, qtd);
1739 switch (dwc2_hcd_get_pipe_type(&qtd->urb->pipe_info)) {
1744 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_FRAME_OVERRUN);
1748 qtd, DWC2_HC_XFER_FRAME_OVERRUN);
1749 dwc2_halt_channel(hsotg, chan, qtd, halt_status);
1762 struct dwc2_qtd *qtd)
1768 qtd->error_count = 0;
1774 // dwc2_hc_handle_tt_clear(hsotg, chan, qtd);
1787 struct dwc2_qtd *qtd)
1813 if (qtd)
1814 dev_dbg(hsotg->dev, "qtd->complete_split %d\n",
1815 qtd->complete_split);
1833 dwc2_halt_channel(hsotg, chan, qtd, chan->halt_status);
1847 struct dwc2_qtd *qtd)
1882 dwc2_release_channel(hsotg, chan, qtd,
1898 dwc2_hc_ack_intr(hsotg, chan, chnum, qtd);
1899 dwc2_hc_xfercomp_intr(hsotg, chan, chnum, qtd);
1901 dwc2_hc_stall_intr(hsotg, chan, chnum, qtd);
1909 qtd->error_count = 0;
1921 dwc2_hc_xacterr_intr(hsotg, chan, chnum, qtd);
1924 dwc2_hc_xacterr_intr(hsotg, chan, chnum, qtd);
1927 dwc2_hc_ahberr_intr(hsotg, chan, chnum, qtd);
1929 dwc2_hc_babble_intr(hsotg, chan, chnum, qtd);
1931 dwc2_hc_frmovrun_intr(hsotg, chan, chnum, qtd);
1940 dwc2_hc_nyet_intr(hsotg, chan, chnum, qtd);
1950 dwc2_hc_nak_intr(hsotg, chan, chnum, qtd);
1960 dwc2_hc_ack_intr(hsotg, chan, chnum, qtd);
1973 dwc2_halt_channel(hsotg, chan, qtd,
1992 qtd->error_count++;
1993 dwc2_update_urb_state_abn(hsotg, chan, chnum, qtd->urb,
1994 qtd, DWC2_HC_XFER_XACT_ERR);
1995 dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
1996 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_XACT_ERR);
2013 struct dwc2_qtd *qtd)
2020 dwc2_hc_chhltd_intr_dma(hsotg, chan, chnum, qtd);
2022 if (!dwc2_halt_status_ok(hsotg, chan, chnum, qtd))
2024 dwc2_release_channel(hsotg, chan, qtd, chan->halt_status);
2029 * Check if the given qtd is still the top of the list (and thus valid).
2032 * the qtd from the top of the list, this will return false (otherwise true).
2034 static bool dwc2_check_qtd_still_ok(struct dwc2_qtd *qtd, struct dwc2_qh *qh)
2043 return (cur_head == qtd);
2049 struct dwc2_qtd *qtd;
2076 * If the channel was halted due to a dequeue, the qtd list might
2077 * be empty or at least the first entry will not be the active qtd.
2100 dev_dbg(hsotg->dev, "## no QTD queued for channel %d ##\n",
2111 qtd = list_first_entry(&chan->qh->qtd_list, struct dwc2_qtd,
2120 dwc2_hc_xfercomp_intr(hsotg, chan, chnum, qtd);
2130 dwc2_hc_chhltd_intr(hsotg, chan, chnum, qtd);
2131 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2135 dwc2_hc_ahberr_intr(hsotg, chan, chnum, qtd);
2136 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2140 dwc2_hc_stall_intr(hsotg, chan, chnum, qtd);
2141 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2145 dwc2_hc_nak_intr(hsotg, chan, chnum, qtd);
2146 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2150 dwc2_hc_ack_intr(hsotg, chan, chnum, qtd);
2151 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2155 dwc2_hc_nyet_intr(hsotg, chan, chnum, qtd);
2156 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2160 dwc2_hc_xacterr_intr(hsotg, chan, chnum, qtd);
2161 qtd, chan->qh))
2165 dwc2_hc_babble_intr(hsotg, chan, chnum, qtd);
2166 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2170 dwc2_hc_frmovrun_intr(hsotg, chan, chnum, qtd);
2171 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))
2175 dwc2_hc_datatglerr_intr(hsotg, chan, chnum, qtd);
2176 if (!dwc2_check_qtd_still_ok(qtd, chan->qh))