Re: [RFC 21/22] USB: Remove bogus USB_PORT_STAT_SUPER_SPEED symbol.

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

 



On Fri, Dec 31, 2010 at 10:36:26PM -0500, Alan Stern wrote:
> On Thu, 30 Dec 2010, Sarah Sharp wrote:
> 
> > USB_PORT_STAT_SUPER_SPEED is a made up symbol that the USB core used to
> > track whether USB ports had a SuperSpeed device attached.  This is a
> > linux-internal symbol that was used when SuperSpeed and non-SuperSpeed
> > devices would show up under the same xHCI roothub.  This particular
> > port status is never returned by external USB 3.0 hubs.  (Instead they
> > have a USB_PORT_STAT_SPEED_5GBPS that uses a completely different speed
> > mask.)
> > 
> > Now that the xHCI driver registers two roothubs, USB 3.0 devices will only
> > show up under USB 3.0 hubs.  Rip out USB_PORT_STAT_SUPER_SPEED and replace
> > it with calls to hub_is_superspeed().
> 
> > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> > index 928bbfe..8a5ea2b 100644
> > --- a/drivers/usb/core/hub.c
> > +++ b/drivers/usb/core/hub.c
> > @@ -161,8 +161,6 @@ static inline char *portspeed(int portstatus)
> >      		return "480 Mb/s";
> >  	else if (portstatus & USB_PORT_STAT_LOW_SPEED)
> >  		return "1.5 Mb/s";
> > -	else if (portstatus & USB_PORT_STAT_SUPER_SPEED)
> > -		return "5.0 Gb/s";
> >  	else
> >  		return "12 Mb/s";
> >  }
> 
> > @@ -3056,9 +3045,16 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
> >  	struct usb_device *udev;
> >  	int status, i;
> >  
> > -	dev_dbg (hub_dev,
> > -		"port %d, status %04x, change %04x, %s\n",
> > -		port1, portstatus, portchange, portspeed (portstatus));
> > +	/* Only USB 3.0 devices connect to SuperSpeed hubs. */
> > +	if (hub_is_superspeed(hub->hdev))
> > +		dev_dbg(hub_dev,
> > +				"port %d, status %04x, change %04x, %s\n",
> > +				port1, portstatus, portchange, "5.0 Gb/s");
> > +	else
> > +		dev_dbg(hub_dev,
> > +				"port %d, status %04x, change %04x, %s\n",
> > +				port1, portstatus, portchange,
> > +				portspeed(portstatus));
> 
> Instead of duplicating this dev_dbg() statement, simply change the
> portspeed() routine to accept a pointer to the hub structure as an
> additional argument.

Sure, will do.

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