/* Store and send the Bulk-only CSW */
csw->Signature = __constant_cpu_to_le32(USB_BULK_CS_SIG);
csw->Tag = fsg->tag;
- csw->Residue = fsg->residue;
+ csw->Residue = cpu_to_le32(fsg->residue);
csw->Status = status;
bh->inreq->length = USB_BULK_CS_WRAP_LEN;
fsg->data_dir = DATA_DIR_TO_HOST;
else
fsg->data_dir = DATA_DIR_FROM_HOST;
- fsg->data_size = cbw->DataTransferLength;
+ fsg->data_size = le32_to_cpu(cbw->DataTransferLength);
if (fsg->data_size == 0)
fsg->data_dir = DATA_DIR_NONE;
fsg->lun = cbw->Lun;
}
/* Find all the endpoints we will use */
+ usb_ep_autoconfig_reset(gadget);
ep = usb_ep_autoconfig(gadget, &fs_bulk_in_desc);
if (!ep)
goto autoconf_fail;