RE: [EXT] Re: [PATCH] Revert "usb: gadget: composite: fix OS descriptors w_value

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

 



> OK, annoying. I am traveling for conferences this/next week so I cannot verify here, but presumably you are correct. Do you perhaps have a more complete capture you can share?

Sure. First, get MSOS feature descriptor:

SETUP packet requesting header:
C0 A1 00 00 04 00 10 00

Data IN response:
28 00 00 00 00 01 04 00
01 00 00 00 00 00 00 00

SETUP packet requesting full descriptor:
C0 A1 00 00 04 00 28 00

DATA IN response:
28 00 00 00 00 01 04 00 
01 00 00 00 00 00 00 00
02 01 57 49 4E 55 53 42 ..WINUSB
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00

This is wIndex 4 and device request. There is no problem as interface/wValue is 0.

Now the property:

SETUP packet requesting header:
C1 A1 02 00 05 00 0A 00

DATA IN response:
8E 00 00 00 00 01 05 00
01 00

SETUP packet requesting full descriptor:
C1 A1 02 00 05 00 8E 00

DATA IN response (3 packets):
00 00 28 00 44 00 65 00  ..(.D.e.
76 00 69 00 63 00 65 00  v.i.c.e.
49 00 6E 00 74 00 65 00  I.n.t.e.
72 00 66 00 61 00 63 00  r.f.a.c.
65 00 47 00 55 00 49 00  e.G.U.I.
44 00 00 00 4E 00 00 00  D...N...

7B 00 43 00 46 00 34 00
39 00 33 00 45 00 31 00
41 00 2D 00 41 00 32 00
37 00 32 00 2D 00 34 00
32 00 32 00 42 00 2D 00
41 00 33 00 36 00 34 00
2D 00 39 00 36 00 37 00
42 00 34 00 39 00 42 00

32 00 36 00 42 00 35 00
37 00 7D 00 00 00

I omitted ACSII value for our interface GUID as it is not important here. 

The important part is wIndex 5 (request number), device request (0xC1) and our interface number 2 at offset 2 which is LOW byte of wValue. There is the problem. Captured at Win10 23H2 but it behaves the same way at least 2 years, probably always.

> It's been a while, but I believe Windows 10. In the end I ended up shuffling the interfaces around so the one with the MSOS descriptors was interface 0 for better compatibility, so it is possible that something went wrong with my interface != 0 tests.

It would be interesting if you can reproduce it but I presume it was a different problem. I tested it at my old Win7 machine and it behaves the same way as at Win10/11 i.e. interface number is in the low byte. Also, Linux implementation had it correctly for a long time and maybe somebody did it for a reason even when MS documentation claims opposite.

> If so, then I am fine with reverting, but we should probably add a comment explaining that the documentation is wrong.

Yes. Note the documentation is from 2007 which is before Win7 release where it was used for the first time.

Michal




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux