Re: [PATCH] USB: Warn about USB3 devices plugged into USB2 hub.

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

 



* Alan Stern | 2012-01-10 10:16:18 [-0500]:

>
>You don't have to be so complicated about it.  Just copy the logic 
>used for highspeed_hubs in hub.c.

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 79d339e..81f3207 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1246,6 +1246,7 @@ static void hub_release(struct kref *kref)
 }
 
 static unsigned highspeed_hubs;
+static unsigned superspeed_hubs;
 
 static void hub_disconnect(struct usb_interface *intf)
 {
@@ -1269,6 +1270,8 @@ static void hub_disconnect(struct usb_interface *intf)
 
 	if (hub->hdev->speed == USB_SPEED_HIGH)
 		highspeed_hubs--;
+	else if (hub->hdev->speed == USB_SPEED_SUPER)
+		superspeed_hubs--;
 
 	usb_free_urb(hub->urb);
 	kfree(hub->port_owners);
@@ -1352,6 +1355,8 @@ descriptor_error:
 
 	if (hdev->speed == USB_SPEED_HIGH)
 		highspeed_hubs++;
+	else if (hub->hdev->speed == USB_SPEED_SUPER)
+		superspeed_hubs++;
 
 	if (hub_configure(hub, endpoint) >= 0)
 		return 0;


Sarah, that is the smaller piece which you could integrate :)

>Alan Stern

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