linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] Revert "usb: gadget: composite: fix OS descriptors w_value
@ 2024-09-11  1:32 Vodicka, Michal
  2024-09-13 15:39 ` Peter Korsgaard
  0 siblings, 1 reply; 13+ messages in thread
From: Vodicka, Michal @ 2024-09-11  1:32 UTC (permalink / raw)
  To: peter@korsgaard.com
  Cc: balbi@kernel.org, linux-usb@vger.kernel.org, Vrastil, Michal,
	stable@kernel.org

> Hmm, very odd. How are you testing this on the host side?

We just attach the device and check the registry values created by OS
for our device. As
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_XXXX&PID_YYYY&MI_NN\<device_instance>\Device Parameters.
When it works our extended properties are created there.

We check the communication using USB analyzer which clearly shows
wValue bytes are in opposite order than documented. This is SETUP
packet captured:

Offset  0   1   2   3   4   5   6   7
0x000   C1  A1  02  00  05  00  0A  00

As you can see, this is interface request and out interface number was
2 which is in the low byte of wValue.

> Could it be that you are running into the WinUSB bug described here:

No. The mentioned bug is in wIndex and out problem is wValue. Also,
MSOS descriptors are read before WinUsb is even run.

Background: we have a composite device which uses MSOS descriptors with
extended properties. It worked well on all tested Win10 and Win11
installations for two years until we applied your original fix which
switches wValue bytes. Then extended properties stopped work. We looked
for the culprit and found this. I understand MS documentation says
interface number is in high byte of wValue but the real implementation
uses low byte for it as was verified using USB analyzer.

Question for you:

> I had issues with getting Windows to accept the OS descriptors when
> the function I wanted to use with WinUSB was not the first (=
> interface 0) function in a composite device together with HID and
> mass storage.

What Windows version were you using and have you used USB analyzer to
check the communication?

Michal

^ permalink raw reply	[flat|nested] 13+ messages in thread
[parent not found: <AS8PR05MB84857AB3DC49395AEC7C235990932@AS8PR05MB8485.eurprd05.prod.outlook.com>]

end of thread, other threads:[~2024-11-13 13:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-11  1:32 [PATCH] Revert "usb: gadget: composite: fix OS descriptors w_value Vodicka, Michal
2024-09-13 15:39 ` Peter Korsgaard
2024-09-20  2:26   ` [EXT] " Vodicka, Michal
2024-10-04 13:33   ` Greg KH
2024-10-16 23:55     ` Elson Serrao
2024-11-12 18:11       ` Elson Serrao
2024-11-13  0:29         ` [EXT] " Vrastil, Michal
2024-11-13  1:38         ` Vodicka, Michal
2024-11-13 13:01         ` Peter Korsgaard
     [not found] <AS8PR05MB84857AB3DC49395AEC7C235990932@AS8PR05MB8485.eurprd05.prod.outlook.com>
2024-09-04 15:01 ` Vrastil, Michal
2024-09-04 17:18   ` Greg KH
2024-09-04 17:31   ` Sergei Shtylyov
2024-09-04 18:19   ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).