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 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.

> @@ -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.

> +	u8			*port_array;
> +	/* Array of pointers to USB 3.0 PORTSC registers */
> +	u32 __iomem		**usb3_ports;
> +	unsigned int		num_usb3_ports;
> +	/* Array of pointers to USB 2.0 PORTSC registers */
> +	u32 __iomem		**usb2_ports;
> +	unsigned int		num_usb2_ports;
>  };

Alan Stern

--
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