|
@@ -84,7 +84,7 @@ struct usb_hub {
|
|
|
|
|
|
static inline int hub_is_superspeed(struct usb_device *hdev)
|
|
|
{
|
|
|
- return (hdev->descriptor.bDeviceProtocol == 3);
|
|
|
+ return (hdev->descriptor.bDeviceProtocol == USB_HUB_PR_SS);
|
|
|
}
|
|
|
|
|
|
/* Protect struct usb_device->state and ->children members
|
|
@@ -1041,58 +1041,58 @@ static int hub_configure(struct usb_hub *hub,
|
|
|
dev_dbg(hub_dev, "standalone hub\n");
|
|
|
|
|
|
switch (wHubCharacteristics & HUB_CHAR_LPSM) {
|
|
|
- case 0x00:
|
|
|
- dev_dbg(hub_dev, "ganged power switching\n");
|
|
|
- break;
|
|
|
- case 0x01:
|
|
|
- dev_dbg(hub_dev, "individual port power switching\n");
|
|
|
- break;
|
|
|
- case 0x02:
|
|
|
- case 0x03:
|
|
|
- dev_dbg(hub_dev, "no power switching (usb 1.0)\n");
|
|
|
- break;
|
|
|
+ case HUB_CHAR_COMMON_LPSM:
|
|
|
+ dev_dbg(hub_dev, "ganged power switching\n");
|
|
|
+ break;
|
|
|
+ case HUB_CHAR_INDV_PORT_LPSM:
|
|
|
+ dev_dbg(hub_dev, "individual port power switching\n");
|
|
|
+ break;
|
|
|
+ case HUB_CHAR_NO_LPSM:
|
|
|
+ case HUB_CHAR_LPSM:
|
|
|
+ dev_dbg(hub_dev, "no power switching (usb 1.0)\n");
|
|
|
+ break;
|
|
|
}
|
|
|
|
|
|
switch (wHubCharacteristics & HUB_CHAR_OCPM) {
|
|
|
- case 0x00:
|
|
|
- dev_dbg(hub_dev, "global over-current protection\n");
|
|
|
- break;
|
|
|
- case 0x08:
|
|
|
- dev_dbg(hub_dev, "individual port over-current protection\n");
|
|
|
- break;
|
|
|
- case 0x10:
|
|
|
- case 0x18:
|
|
|
- dev_dbg(hub_dev, "no over-current protection\n");
|
|
|
- break;
|
|
|
+ case HUB_CHAR_COMMON_OCPM:
|
|
|
+ dev_dbg(hub_dev, "global over-current protection\n");
|
|
|
+ break;
|
|
|
+ case HUB_CHAR_INDV_PORT_OCPM:
|
|
|
+ dev_dbg(hub_dev, "individual port over-current protection\n");
|
|
|
+ break;
|
|
|
+ case HUB_CHAR_NO_OCPM:
|
|
|
+ case HUB_CHAR_OCPM:
|
|
|
+ dev_dbg(hub_dev, "no over-current protection\n");
|
|
|
+ break;
|
|
|
}
|
|
|
|
|
|
spin_lock_init (&hub->tt.lock);
|
|
|
INIT_LIST_HEAD (&hub->tt.clear_list);
|
|
|
INIT_WORK(&hub->tt.clear_work, hub_tt_work);
|
|
|
switch (hdev->descriptor.bDeviceProtocol) {
|
|
|
- case 0:
|
|
|
- break;
|
|
|
- case 1:
|
|
|
- dev_dbg(hub_dev, "Single TT\n");
|
|
|
- hub->tt.hub = hdev;
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- ret = usb_set_interface(hdev, 0, 1);
|
|
|
- if (ret == 0) {
|
|
|
- dev_dbg(hub_dev, "TT per port\n");
|
|
|
- hub->tt.multi = 1;
|
|
|
- } else
|
|
|
- dev_err(hub_dev, "Using single TT (err %d)\n",
|
|
|
- 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);
|
|
|
- break;
|
|
|
+ case USB_HUB_PR_FS:
|
|
|
+ break;
|
|
|
+ case USB_HUB_PR_HS_SINGLE_TT:
|
|
|
+ dev_dbg(hub_dev, "Single TT\n");
|
|
|
+ hub->tt.hub = hdev;
|
|
|
+ break;
|
|
|
+ case USB_HUB_PR_HS_MULTI_TT:
|
|
|
+ ret = usb_set_interface(hdev, 0, 1);
|
|
|
+ if (ret == 0) {
|
|
|
+ dev_dbg(hub_dev, "TT per port\n");
|
|
|
+ hub->tt.multi = 1;
|
|
|
+ } else
|
|
|
+ dev_err(hub_dev, "Using single TT (err %d)\n",
|
|
|
+ ret);
|
|
|
+ hub->tt.hub = hdev;
|
|
|
+ break;
|
|
|
+ case USB_HUB_PR_SS:
|
|
|
+ /* USB 3.0 hubs don't have a TT */
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ dev_dbg(hub_dev, "Unrecognized hub protocol %d\n",
|
|
|
+ hdev->descriptor.bDeviceProtocol);
|
|
|
+ break;
|
|
|
}
|
|
|
|
|
|
/* Note 8 FS bit times == (8 bits / 12000000 bps) ~= 666ns */
|