Fix for reception of large full speed isochronous frames via the transaction

translator, when using the DWC OTG USB controller driver. Make sure to re-try
getting the complete split packets until a DATA0 packet is received. Larger
isochronous frames may be split into multiple MDATA packets terminated
by a single DATA0 packet.

PR:			230434
MFC after:		3 days
Approved by:		re (gjb)
Sponsored by:		Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2018-10-16 18:47:13 +00:00
parent 8bb6c72e63
commit a38abbfb00
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=339388

View File

@ -1458,6 +1458,8 @@ dwc_otg_host_data_rx(struct dwc_otg_softc *sc, struct dwc_otg_td *td)
/* check if we are complete */
if (td->tt_xactpos == HCSPLT_XACTPOS_BEGIN) {
goto complete;
} else if (td->hcsplt != 0) {
goto receive_pkt;
} else {
/* get more packets */
goto busy;
@ -1516,8 +1518,10 @@ dwc_otg_host_data_rx(struct dwc_otg_softc *sc, struct dwc_otg_td *td)
if (td->hcsplt != 0) {
delta = td->tt_complete_slot - sc->sc_last_frame_num - 1;
if (td->tt_scheduled == 0 || delta < DWC_OTG_TT_SLOT_MAX) {
td->state = DWC_CHAN_ST_WAIT_C_PKT;
goto busy;
if (td->ep_type != UE_ISOCHRONOUS) {
td->state = DWC_CHAN_ST_WAIT_C_PKT;
goto busy;
}
}
delta = sc->sc_last_frame_num - td->tt_start_slot;
if (delta > DWC_OTG_TT_SLOT_MAX) {
@ -1563,12 +1567,23 @@ dwc_otg_host_data_rx(struct dwc_otg_softc *sc, struct dwc_otg_td *td)
hcchar = td->hcchar;
hcchar |= HCCHAR_EPDIR_IN;
/* receive complete split ASAP */
if ((sc->sc_last_frame_num & 1) != 0 &&
td->ep_type == UE_ISOCHRONOUS)
hcchar |= HCCHAR_ODDFRM;
else
if (td->ep_type == UE_ISOCHRONOUS) {
if (td->hcsplt != 0) {
/* continously buffer */
if (sc->sc_last_frame_num & 1)
hcchar &= ~HCCHAR_ODDFRM;
else
hcchar |= HCCHAR_ODDFRM;
} else {
/* multi buffer, if any */
if (sc->sc_last_frame_num & 1)
hcchar |= HCCHAR_ODDFRM;
else
hcchar &= ~HCCHAR_ODDFRM;
}
} else {
hcchar &= ~HCCHAR_ODDFRM;
}
/* must enable channel before data can be received */
DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(channel), hcchar);