mbox series

[0/2] wMaxPacketSize handling

Message ID 20190131145340.9820-1-andrzej.p@collabora.com (mailing list archive)
Headers show
Series wMaxPacketSize handling | expand

Message

Andrzej Pietrasiewicz Jan. 31, 2019, 2:53 p.m. UTC
Dear All,

While playing with FunctionFS I have noticed that high speed descriptors passed
from userspace get overwritten by usb_ep_autoconfig() function. It happens for
bulk endpoints, to be precise.

At the time of this writing (5.0-rc4) there are 6 users of usb_ep_autoconfig(),
who call it for descriptors which are not fs descriptors: f_fs, f_midi, f_uac1,
f_uac1_legacy, f_uvc, legacy/dbgp. All but f_fs either don't use bulk endpoints
with usb_ep_autoconfig() or take care to adjust the autoconfigured descriptor.
The second patch in this series makes f_fs aware of the fact that
autoconfiguration may overwrite wMaxPacketSize.

I also simplified the usb_ep_autoconfig_ss() function by moving the
non-super speed code to usb_ep_autoconfig().

Rebased onto v5.0-rc4.

Andrzej Pietrasiewicz (2):
  usb: gadget: move non-super speed code out of usb_ep_autoconfig_ss()
  usb: gadget: f_fs: preserve wMaxPacketSize across usb_ep_autoconfig()
    call

 drivers/usb/gadget/epautoconf.c    | 41 +++++++++++++++++-------------
 drivers/usb/gadget/function/f_fs.c | 11 ++++++++
 2 files changed, 35 insertions(+), 17 deletions(-)