linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Allen Blaylock <AllenB@epiloglaser.com>
Cc: Manu Gautam <mgautam@codeaurora.org>,
	Peter Chen <peter.chen@nxp.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: RE: EHSET with hub and PCIe root hub
Date: Thu, 12 Sep 2019 16:51:15 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.1909121648280.1305-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <BYAPR20MB2501A4FBEDBBC6353B6EC585CCB00@BYAPR20MB2501.namprd20.prod.outlook.com>

On Thu, 12 Sep 2019, Allen Blaylock wrote:

> >I should add that the USB 2.0 spec includes the following text (from section 11.24.2.13):
> >
> >        Test mode of a downstream facing port can only be used in
> >        a well defined sequence of hub states. This sequence is
> >        defined as follows:
> >
> >        1)  All enabled downstream facing ports of the hub containing
> >            the port to be tested must be (selectively) suspended via
> >            the SetPortFeature(PORT_SUSPEND) request.  Each downstream
> >            facing port of the hub must be in the disabled,
> >            disconnected, or suspended state (see Figure 11-9).
> >
> >So you can see the hub probably failed the request because a non-suspended device was connected to port 3.  (And who knows what was attached to the other ports -- the usbmon trace doesn't say.)
> >
> >Alan Stern
> 
> This was very helpful.
> 
> I was able to get the USB3503 to generate test packets by adding a SetPortFeature(PORT_SUSPEND) request to suspend the port before setting the PORT_TEST feature. Is there a way to tell that a device is a hub but not a root hub so ports on root hub ports aren't suspended prior to calling SetPortFeature(PORT_TEST)?
> 
> I tried to use hub_udev->maxchild to determine if something was a hub but this appears misguided since root hubs can have multiple children, nothing else in the usb_device structure jumped out as being directly related to a hub.

That's a perfectly good way to see that the device really is a hub.  In
addition, if hub_udev->parent == NULL then hub_udev is a root hub,
otherwise it isn't.

Alan Stern


  reply	other threads:[~2019-09-12 20:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-10 22:01 EHSET with hub and PCIe root hub Allen Blaylock
2019-09-11  2:57 ` Peter Chen
2019-09-11  3:54   ` Manu Gautam
2019-09-11 20:34     ` Allen Blaylock
2019-09-12  0:49       ` Peter Chen
2019-09-12 14:20       ` Alan Stern
2019-09-12 14:28         ` Alan Stern
2019-09-12 20:32           ` Allen Blaylock
2019-09-12 20:51             ` Alan Stern [this message]
2019-09-16  1:11               ` Peter Chen
2019-09-12 14:29         ` Allen Blaylock

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-all 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=Pine.LNX.4.44L0.1909121648280.1305-100000@iolanthe.rowland.org \
    --to=stern@rowland.harvard.edu \
    --cc=AllenB@epiloglaser.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mgautam@codeaurora.org \
    --cc=peter.chen@nxp.com \
    /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;
as well as URLs for NNTP newsgroup(s).