Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1369401

Re: [PATCH] usb: gadget: f_midi: Fixed a bug when buflen was smaller than wMaxPacketSize

From Felipe Ferreri Tonello <eu@felipetonello.com>
Newsgroups linux.kernel
Subject Re: [PATCH] usb: gadget: f_midi: Fixed a bug when buflen was smaller than wMaxPacketSize
Date 2016-04-01 17:00 +0200
Message-ID <rj8Ih-5RJ-9@gated-at.bofh.it> (permalink)
References (1 earlier) <rbElZ-54U-51@gated-at.bofh.it> <rim0W-44B-5@gated-at.bofh.it> <rinzI-5mS-7@gated-at.bofh.it> <rj3yV-2hY-3@gated-at.bofh.it> <rj4uZ-2Tc-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi Balbi,

On 01/04/16 11:22, Felipe Balbi wrote:
> 
> Hi,
> 
> Felipe Ferreri Tonello <eu@felipetonello.com> writes:
>> Hi Balbi and Mina,
>>
>> On 30/03/16 13:33, Michal Nazarewicz wrote:
>>> On Wed, Mar 30 2016, Felipe Balbi wrote:
>>>> a USB packet, right. that's correct. But a struct usb_request can
>>>> point to whatever size buffer it wants and UDC is required to split
>>>> that into wMaxPacketSize transfers.
>>>
>>> D’oh.  Of course.  Disregard all my comments on the patch (except for
>>> Ack).
>>>
>>
>> I didn't really get it. Does that mean that if buflen is multiple of
>> wMaxPacketSize, the UDC driver should fit as many [DATA] packets into
>> one usb_request and call complete() or it will always call complete() on
>> each [DATA] packet, thus not requiring buflen at all?
>>
>> Does that mean that we can still use buflen and this patch is still
>> valid? (besides the endianess issue that was addressed on v2)
> 
> if you have e.g. 2048 bytes of data to transfer and wMaxPacketSize is
> e.g. 256 bytes, the UDC controller is required to do whatever it needs
> to do to transfer 2048 bytes (or less if there's a short packet).
> 
> You don't need to break these 2048 bytes into several requests yourself,
> the UDC is required to do that for the gadget.

Right, what about OUT endpoints?

So that means that buflen is still usable, at least on IN endpoints.

-- 
Felipe

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: [PATCH] usb: gadget: f_midi: Fixed a bug when buflen was smaller than wMaxPacketSize Felipe Balbi <balbi@kernel.org> - 2016-03-30 13:00 +0200
  Re: [PATCH] usb: gadget: f_midi: Fixed a bug when buflen was smaller than wMaxPacketSize Michal Nazarewicz <mina86@mina86.com> - 2016-03-30 14:40 +0200
    Re: [PATCH] usb: gadget: f_midi: Fixed a bug when buflen was smaller  than wMaxPacketSize Felipe Ferreri Tonello <eu@felipetonello.com> - 2016-04-01 11:30 +0200
      Re: [PATCH] usb: gadget: f_midi: Fixed a bug when buflen was smaller than wMaxPacketSize Felipe Balbi <balbi@kernel.org> - 2016-04-01 12:30 +0200
        Re: [PATCH] usb: gadget: f_midi: Fixed a bug when buflen was smaller  than wMaxPacketSize Felipe Ferreri Tonello <eu@felipetonello.com> - 2016-04-01 17:00 +0200

csiph-web