Re: [PATCH v2] USB: gadget: add "maxpacket_limit" field to struct usb_ep

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

 



On 12/12/2013 08:14 PM, Paul Zimmerman wrote:
>> From: linux-usb-owner@xxxxxxxxxxxxxxx [mailto:linux-usb-owner@xxxxxxxxxxxxxxx] On Behalf Of Robert Baldyga
>> Sent: Thursday, December 12, 2013 12:51 AM
>>
>> This patch adds "maxpacket_limit" to struct usb_ep. This field contains
>> maximum value of maxpacket supported by driver, and is set in driver probe.
>> This value should be used by autoconfig() function, because value of field
>> "maxpacket" is set to value from endpoint descriptor when endpoint becomes
>> enabled. So when autoconfig() function will be called again for this endpoint,
>> "maxpacket" value will contain wMaxPacketSize from descriptior instead of
>> maximum packet size for this endpoint.
> 
> Can you describe what the exact problem is that this patch is trying to
> solve? Under what circumstances does the problem show up? And perhaps a
> pointer to any previous email thread where this was discussed? Thanks.
> 
Hello Paul,

This problem shows up when you unload gadget which uses, for example,
maxpacket=64 for its endpoints, and then you want to load gadget which
want to use greater maxpacket value (for example maxpacket=512).

In described case autoconfig() function will not be able to return
endpoints used by previous gadget, because their "maxpacket" field is
set to 64, and it seems to be maximum supported value.

Using additional field "maxpacket_limit" to store original value set by
UDC driver solves this problem, because autoconfig can see maximum
packet value handled by endpoint irrespectively to "maxpacket" value
used by previously loaded gadget.

Best regards
Robert Baldyga
Samsung R&D Institute Poland
--
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