usb: gadget: How should an udc handle reception of more data than req.length?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi!

In short: How should a udc driver handle a situation when the host sends more data than req.length in the receiving OUT request? What
should be reported to the gadget driver? What should be done with the
excess data?

Currently the gr_udc driver does not accept OUT requests if req.length
is not a multiple of ep.maxpacket. This is because the hardware cannot
be told to write smaller data sizes than ep.maxpacket. (This works fine
for mass storage for instance that makes sure to supply request buffers
that are even multiples of ep.maxpacket, but not all gadget drivers do this.)

I am looking into lifting this limitation by using an internal buffer in
gr_udc.c in that is used instead of end of the req.buf that is
not (necessarily) a full multiple of ep.maxpacket and then copy received data from the internal buffer to the request buffer.

The problem is that the gr_udc driver then can end up in the situation
where it receives more data than req.length (e.g. a full sized packet of
size ep.maxpacket). What should be done in the udc driver in this case?
What should be reported to the gadget driver? What should be done with
the excess data?


Best regards,

Andreas Larsson
Software Engineer
Aeroflex Gaisler AB
Aeroflex Microelectronic Solutions – HiRel
Kungsgatan 12
SE-411 19 Gothenburg, Sweden
Phone: +46 31 7758669
andreas@xxxxxxxxxxx
www.Aeroflex.com/Gaisler
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux