Hi, david preetham <preetham.david@xxxxxxxxx> writes: > Dear Balbi, > > In DWC3 USB device controller, on which basis event->status & > DEPEVT_STATUS_SHORT is set when we have a short packet > who will set? I understand if we receive less bytes we are going to HW will set it > set short packet. > > Suppose gadget driver requested 1MB req length, DWC3 forms TRB size with > gadget(MTP) request length. If host sends less data event status is set to > DEPEVT_STATUS_SHORT. In function __dwc3_cleanup_done_trbs there is check if > (count && (event->status & DEPEVT_STATUS_SHORT)), before givingback request > to gadget driver. Currently in MTP gadget driver relies on short packet for > EOF for large files(more than 4GB it don’t have file length size > information) f_mtp.c (receive_file_work) reference. > > > > How device controller will know short packet or end of transfer apart from > checking req length and received length from host is there anything host > informs this is short packet to device controller? Suppose there 2gb file > is getting transfer from host to device. How host will make sure EOF or > short transfer for complete 2gb file. Short packet is when a packet is smaller than wMaxPacketSize. Assuming we're discussing bulk endpoints with a SS USB link, then wMaxPacketSize will be 1024. If you have a file that's exactly 2GiB (2*1024*1024, or 2^31), then you don't have a short packet. I'm assuming host would have to send a ZLP to signify the end of the transfer. -- balbi
Attachment:
signature.asc
Description: PGP signature