usb: nrf: Do not allow to clear STALL or dtoggle for ISO ep.

Isochronous transactions do not support handshake phase
so in particular the ISO endpoint cannot be STALLed.
Isochronous transactions do no support data toggle sequencing
and should only send DATA0 PID.

Taking into consideration those requirements do not try to
clear dtoggle or STALL an ISO Endpoint in nRF USBD driver.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
This commit is contained in:
Emil Obalski 2020-09-14 14:20:57 +02:00 committed by Ioannis Glaropoulos
commit dc79b37167

View file

@ -1565,6 +1565,11 @@ int usb_dc_ep_clear_stall(const uint8_t ep)
return -EINVAL;
}
if (NRF_USBD_EPISO_CHECK(ep)) {
/* ISO transactions do not support a handshake phase. */
return -EINVAL;
}
nrfx_usbd_ep_dtoggle_clear(ep_addr_to_nrfx(ep));
nrfx_usbd_ep_stall_clear(ep_addr_to_nrfx(ep));
LOG_DBG("Unstall on EP 0x%02x", ep);
@ -1612,7 +1617,12 @@ int usb_dc_ep_enable(const uint8_t ep)
return -EINVAL;
}
nrfx_usbd_ep_dtoggle_clear(ep_addr_to_nrfx(ep));
if (!NRF_USBD_EPISO_CHECK(ep)) {
/* ISO transactions for full-speed device do not support
* toggle sequencing and should only send DATA0 PID.
*/
nrfx_usbd_ep_dtoggle_clear(ep_addr_to_nrfx(ep));
}
if (ep_ctx->cfg.en) {
return -EALREADY;
}