/* Checks the DATA phase transfer and launch the next step The next step can be a CSW packet or a endpoint reset in case of STALL.  */
static void uhi_msc_data_transfered(usb_add_t add, usb_ep_t ep, uhd_trans_status_t status, iram_size_t nb_transfered)
/* Checks the DATA phase transfer and launch the next step The next step can be a CSW packet or a endpoint reset in case of STALL.  */
static void uhi_msc_data_transfered(usb_add_t add, usb_ep_t ep, uhd_trans_status_t status, iram_size_t nb_transfered)
{
	usb_ep_t endp;
	UNUSED(add);
	UNUSED(ep);
	UNUSED(nb_transfered);
	if (status != UHD_TRANS_NOERROR) {
		if (status == UHD_TRANS_STALL) {
			if (uhi_msc_cbw.bmCBWFlags & USB_CBW_DIRECTION_IN) {
				endp = uhi_msc_dev_sel->ep_in;
			} else {
				endp = uhi_msc_dev_sel->ep_out;
			}
			uhi_msc_reset_endpoint(endp, uhi_msc_data_csw_rst_stall);
			return;
		}
		uhi_msc_scsi_sub_callback(false);
		return;
	}
	uhi_msc_csw_wait();
	return;
}