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