Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix super-speed handling #113

Merged
merged 2 commits into from
Nov 4, 2024
Merged

Conversation

js731ca
Copy link
Contributor

@js731ca js731ca commented Nov 4, 2024

from one of our contractors:

umtp-responder: fix super-speed handling
     
     Add the patches required to configure the USB SuperSpeed descriptors
     correctly. Without the patches the host USB SuperSpeed negotiation fails
     and the USB OTG mechanism (autom. host<->device switch) fails too.
     
     Signed-off-by: Marco Felsch <[email protected]>

Albeit the name suggesting it, this option is not used for
the USB descriptor setup instead it is only the MTP protocol which uses it.

An usage example on i.MX8MP - which supports USB2.0 OTG and USB3.0 OTG:

## /etc/umtprd/umtprd.conf

# SuperSpeed max. package size is 1024
usb_max_packet_size 0x400

Marco Felsch added 2 commits November 4, 2024 15:27
The SuperSpeed companion descriptor was not set to zero which can lead
into bogus params send to the host. Also set bMaxBurst to zero to be
compatible with more USB3.0 controller HW out-of-the box.

Signed-off-by: Marco Felsch <[email protected]>
The wMaxPacketSize is defined by the USB spec:
 - FS/HS: 512 bytes
 - SS: 1024 bytes

Since the SS require FS/HS descriptors we can't just use a single value
here. Drop the config value usage and set it according the spec instead.

Signed-off-by: Marco Felsch <[email protected]>
@jfdelnero jfdelnero merged commit f459eba into viveris:master Nov 4, 2024
@jfdelnero
Copy link
Member

Hello,

@js731ca i am trying to remove this last "usb_max_packet_size" user defined variable.

But for this i need to find a way to know which packet size i need to use when the connection is established.

To do this i need to know one of these points :

  • Which speed is used ?

or

  • Which descriptor is finally used for the current connection.

or even better :

  • What is the current wMaxPacketSize used.

Have you any idea how to get on of these information through the GadgetFS / FunctionFS layer ?

@js731ca
Copy link
Contributor Author

js731ca commented Jan 28, 2025

@bith3ad these patches came initially from you, wanna chime in? :-)
in the commits it's mentioned that the values are according to the USB-specification.
my first guess would be to look at the sysfs entries of the udc (usb device controller) the usb-gadget uses?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants