Re: [PATCH 09/23] Add USB 3.0 roothub support to USB core.

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

 





+
 /*-------------------------------------------------------------------------*/
/*
@@ -426,7 +488,9 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
 	case DeviceRequest | USB_REQ_GET_DESCRIPTOR:
 		switch (wValue & 0xff00) {
 		case USB_DT_DEVICE << 8:
-			if (hcd->driver->flags & HCD_USB2)
+			if (hcd->driver->flags & HCD_USB3)
+				bufp = usb3_rh_dev_descriptor;
+			else if (hcd->driver->flags & HCD_USB2)
 				bufp = usb2_rh_dev_descriptor;
 			else if (hcd->driver->flags & HCD_USB11)
 				bufp = usb11_rh_dev_descriptor;
I think better to replace "if ... else if... else" with switch case as you did in patch [06/23]

@@ -437,7 +501,10 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
 				patch_protocol = 1;
 			break;
 		case USB_DT_CONFIG << 8:
-			if (hcd->driver->flags & HCD_USB2) {
+			if (hcd->driver->flags & HCD_USB3) {
+				bufp = ss_rh_config_descriptor;
+				len = sizeof ss_rh_config_descriptor;
+			} else if (hcd->driver->flags & HCD_USB2) {
 				bufp = hs_rh_config_descriptor;
 				len = sizeof hs_rh_config_descriptor;
 			} else {
same here....
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 54895dc..2f08452 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -155,6 +155,8 @@ static inline char *portspeed(int portstatus)
     		return "480 Mb/s";
 	else if (portstatus & (1 << USB_PORT_FEAT_LOWSPEED))
 		return "1.5 Mb/s";
+	else if (portstatus & (1 << USB_PORT_FEAT_SUPERSPEED))
+		return "5.0 Gb/s";
 	else
 		return "12 Mb/s";
 }
@@ -951,6 +953,9 @@ static int hub_configure(struct usb_hub *hub,
 					ret);
 			hub->tt.hub = hdev;
 			break;
+		case 3:
+			/* USB 3.0 hubs don't have a TT */
+			break;
 		default:
 			dev_dbg(hub_dev, "Unrecognized hub protocol %d\n",
 				hdev->descriptor.bDeviceProtocol);
diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h
index 2a116ce..889c0f3 100644
--- a/drivers/usb/core/hub.h
+++ b/drivers/usb/core/hub.h
@@ -47,7 +47,10 @@
 #define USB_PORT_FEAT_L1		5	/* L1 suspend */
 #define USB_PORT_FEAT_POWER		8
 #define USB_PORT_FEAT_LOWSPEED		9
+/* This value was never in Table 11-17 */
 #define USB_PORT_FEAT_HIGHSPEED		10
+/* This value is also fake */
+#define USB_PORT_FEAT_SUPERSPEED	11
 #define USB_PORT_FEAT_C_CONNECTION	16
 #define USB_PORT_FEAT_C_ENABLE		17
 #define USB_PORT_FEAT_C_SUSPEND		18
--
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