Re: [RFC 06/15] xhci: Setup array of USB 2.0 and USB 3.0 ports.

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

 



On Tue, Nov 30, 2010 at 11:06:21AM -0500, Alan Stern wrote:
> On Mon, 29 Nov 2010, Sarah Sharp wrote:
> 
> > An xHCI host controller contains USB 2.0 and USB 3.0 ports, which can
> > occur in any order in the PORTSC registers.  We cannot read the port speed
> > bits in the PORTSC registers at init time to determine the port speed,
> > since those bits are only valid when a USB device is plugged into the
> > port.
> > 
> > Instead, we read the "Supported Protocol Capability" registers in the xHC
> > Extended Capabilities space.  Those describe the protocol, port offset in
> > the PORTSC registers, and port count.  We use those registers to create
> > two arrays of pointers to the PORTSC registers, one for USB 3.0 ports, and
> > another for USB 2.0 ports.  A third array keeps track of the port protocol
> > major revision, and is indexed with the internal xHCI port number.
> > 
> > This will make it easy to keep track of the port types to handle the xHCI
> > driver faking two roothubs.  The two arrays of pointers can be used to
> > index the port the USB core wants, and the third array can be used to map
> > xHC port status change event to the correct roothub that should process
> > that event.
> 
> > +	/*
> > +	 * Note we could have all USB 3.0 ports, or all USB 2.0 ports.
> 
> I don't think you can have all USB-3 ports unless there are no ports at
> all.  The spec requires each USB-3 port to have a corresponding USB-2
> port.

Which spec?  The xHCI spec or the USB 3.0 spec?  I'm not so sure that's
a hard requirement, because there was always hopeful talk of "when we
can remove those USB 2.0 wires".  I'm not sure that will ever be likely
to happen because of the massive amount of USB 2.0 devices, but it did
seem like they left the possibility in the xHCI specification.

I think it could be likely that a vendor decides it wants to have an
internal xHCI host that only needs to support USB 3.0 devices (say a
webcam and a mass storage device), and their xHCI host only has USB 3.0
ports.  I'd rather play it safe and write code that works for this case.

> > @@ -1234,6 +1252,14 @@ struct xhci_hcd {
> >  	u32			suspended_ports[8];	/* which ports are
> >  							   suspended */
> >  	unsigned long		resume_done[MAX_HC_PORTS];
> > +	/* Is each xHCI roothub port a USB 3.0, USB 2.0, or USB 1.1 port? */
> 
> This comment is unclear; the port_array field doesn't answer the
> question asked in the comment.  Furthermore, none of the ports can be
> USB 1.1 -- they all have to be USB-2 or USB-3.

Ok, I'll fix it.

Sarah
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  Powered by Linux