public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Tian, Feng" <feng.tian@intel.com>
To: Yosuke Katayama1 <ykatayama1@lenovo.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Tian, Feng" <feng.tian@intel.com>
Subject: Re: [USB IF]Mismatch between EDK2 and a USB vendor
Date: Wed, 21 Sep 2016 06:13:40 +0000	[thread overview]
Message-ID: <7F1BAD85ADEA444D97065A60D2E97EE566E1D722@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <5F5B41F3CAC51543B46516F1A5F982DC24BCE1F7@APMAILMBX03.lenovo.com>

Hi, Katayama

We never receive such feedback on inconsecutive usb interface number. I agree EDKII usb driver should be able to handle this.

I am working on a fix, but I have no such device at hand. Could you help me verify it when the patch is ready? 

PS: what host controller are you using? EHCI or XHCI?

Thanks
Feng

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Yosuke Katayama1
Sent: Wednesday, September 21, 2016 8:05 AM
To: edk2-devel@lists.01.org
Subject: [edk2] [EDK2][USB IF]Mismatch between EDK2 and a USB vendor

Hello, 

This is relating to my previous post "[edk2] Is this a right place to discuss EDK2's USB IF implementation?" 
We found a mismatch between EDK2 source code and our USB vendor's implementation. Could you give us your opinions?


bInterfaceNumber , 9.6.5 Interface from Universal Serial Bus 3.1 Specification Rev 1.0 says;
--
Number of this interface. Zero-based value identifying the index in the array of concurrent interfaces supported by this configuration.
--


Regarding this.
EDK2 source code (UsbDesc.c) says:
--
  //
  // If a configuration has several interfaces, these interfaces are
  // numbered from zero to n...
  //
--


The USB vendor says:
--
* Numbering is not necessarily consecutive * Each interface can be independently turned on/off * Solution allows any combination of interfaces without re-defining the interface number * One general lookup table can tell you what interface is assigned to what interface number.
* For these reasons, the interface definition is like this on our products.
* The interface definition has remained the same from the previous products, and other products before that.
* Current interface numbering is supported by all Microsoft OS * Other PC OEM customers have never raised this issue
--

As a result, the vendor's USB IF looks like below.

===>Configuration Descriptor<===
...
bNumInterfaces:                    0x02				<<<<
bConfigurationValue:               0x01
iConfiguration:                    0x00
bmAttributes:                      0xA0  -> Bus Powered
  -> Remote Wakeup
...
          ===>Interface Descriptor<===
...
bInterfaceNumber:                  0x0C				<<<<	Interface Number starts from 0x0C instead of 0. [comment from Yosuke]
bAlternateSetting:                 0x00
bNumEndpoints:                     0x01
...

          ===>Interface Descriptor<===
...
bInterfaceNumber:                  0x0D                            <<<<
bAlternateSetting:                 0x00
bNumEndpoints:                     0x00
...


and it hits the following ON_ERROR in UsbDesc.c.
--
    } else if (Setting->Desc.InterfaceNumber >= NumIf) {
      DEBUG (( EFI_D_ERROR, "UsbParseConfigDesc: mal-formated interface descriptor\n"));

      UsbFreeInterfaceDesc (Setting);
      goto ON_ERROR;
    }
--


What do you think the vendor's implementation?
Also, have you ever had such a USB IF mismatch between EDK2 and USB vendors before? If so, how are you handling such cases in general?

Kind regards,
Yosuke
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


  reply	other threads:[~2016-09-21  6:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-21  0:04 [USB IF]Mismatch between EDK2 and a USB vendor Yosuke Katayama1
2016-09-21  6:13 ` Tian, Feng [this message]
2016-09-21  8:14   ` Yosuke Katayama1
2016-09-21  8:34     ` Tian, Feng
2016-10-18 10:00   ` Yosuke Katayama1

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7F1BAD85ADEA444D97065A60D2E97EE566E1D722@SHSMSX101.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox