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


Groups > linux.kernel > #1256610

Re: [PATCH v4 1/7] usb: gadget: f_midi: Transmit data only when IN ep is enabled

From Felipe Ferreri Tonello <eu@felipetonello.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 1/7] usb: gadget: f_midi: Transmit data only when IN ep is enabled
Date 2015-10-27 10:30 +0100
Message-ID <qo8JR-3sW-15@gated-at.bofh.it> (permalink)
References <qnThM-2d0-3@gated-at.bofh.it> <qnThN-2d0-19@gated-at.bofh.it> <qnYhr-5rl-11@gated-at.bofh.it> <qnYUa-5Ev-11@gated-at.bofh.it> <qo6eZ-1SY-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Robert,

On 27/10/15 06:41, Robert Baldyga wrote:
> On 10/26/2015 11:49 PM, Felipe Tonello wrote:
>> Hi Robert,
>>
>> On Mon, Oct 26, 2015 at 10:13 PM, Robert Baldyga
>> <r.baldyga@hackerion.com> wrote:
>>> Hi Felipe,
>>>
>>> On 10/26/2015 05:55 PM, Felipe F. Tonello wrote:
>>>> This makes sure f_midi doesn't try to enqueue data when the IN endpoint is
>>>> disabled, ie, USB cable is disconnected.
>>>>
>>>> Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
>>>> ---
>>>>  drivers/usb/gadget/function/f_midi.c | 7 ++++++-
>>>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c
>>>> index edb84ca..e08f365 100644
>>>> --- a/drivers/usb/gadget/function/f_midi.c
>>>> +++ b/drivers/usb/gadget/function/f_midi.c
>>>> @@ -87,6 +87,7 @@ struct f_midi {
>>>>       int index;
>>>>       char *id;
>>>>       unsigned int buflen, qlen;
>>>> +     bool in_ep_enabled;
>>>
>>> It's not necessary, you can use ep->enabled flag instead.
>>
>> There is no such flag in usb_ep struct[1].
>>
>> [1] http://lxr.free-electrons.com/source/include/linux/usb/gadget.h#L170
> 
> It's already in next branch of Felipe Balbi's tree.
> 
> Look here:
> https://git.kernel.org/cgit/linux/kernel/git/balbi/usb.git/

Cool. Thanks.

I though that this flag would be very useful, but didn't want to add to
the main struct as it seems no other driver cared about this flag. But
it is good to see that it is been merged now.

-- 
Felipe
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

[PATCH v4 1/7] usb: gadget: f_midi: Transmit data only when IN ep is enabled "Felipe F. Tonello" <eu@felipetonello.com> - 2015-10-26 18:00 +0100
  Re: [PATCH v4 1/7] usb: gadget: f_midi: Transmit data only when IN ep  is enabled Robert Baldyga <r.baldyga@hackerion.com> - 2015-10-26 23:20 +0100
    Re: [PATCH v4 1/7] usb: gadget: f_midi: Transmit data only when IN ep  is enabled Felipe Tonello <eu@felipetonello.com> - 2015-10-27 00:00 +0100
      Re: [PATCH v4 1/7] usb: gadget: f_midi: Transmit data only when IN ep  is enabled Robert Baldyga <r.baldyga@samsung.com> - 2015-10-27 07:50 +0100
        Re: [PATCH v4 1/7] usb: gadget: f_midi: Transmit data only when IN ep  is enabled Felipe Ferreri Tonello <eu@felipetonello.com> - 2015-10-27 10:30 +0100

csiph-web