NULL\r
};\r
\r
+UINT16 mMaxUsbDeviceNum = USB_MAX_DEVICES;\r
\r
/**\r
USB_IO function to execute a control transfer. This\r
// Clear TT buffer when CTRL/BULK split transaction failes\r
// Clear the TRANSLATOR TT buffer, not parent's buffer\r
//\r
- ASSERT (Dev->Translator.TranslatorHubAddress < USB_MAX_DEVICES);\r
+ ASSERT (Dev->Translator.TranslatorHubAddress < mMaxUsbDeviceNum);\r
if (Dev->Translator.TranslatorHubAddress != 0) {\r
UsbHubCtrlClearTTBuffer (\r
Dev->Bus->Devices[Dev->Translator.TranslatorHubAddress],\r
// Clear TT buffer when CTRL/BULK split transaction failes.\r
// Clear the TRANSLATOR TT buffer, not parent's buffer\r
//\r
- ASSERT (Dev->Translator.TranslatorHubAddress < USB_MAX_DEVICES);\r
+ ASSERT (Dev->Translator.TranslatorHubAddress < mMaxUsbDeviceNum);\r
if (Dev->Translator.TranslatorHubAddress != 0) {\r
UsbHubCtrlClearTTBuffer (\r
Dev->Bus->Devices[Dev->Translator.TranslatorHubAddress],\r
goto CLOSE_HC;\r
}\r
\r
+ if (!EFI_ERROR (Status)) {\r
+ if (UsbBus->Usb2Hc->MajorRevision == 0x3) {\r
+ //\r
+ // The EFI_USB2_HC_PROTOCOL is produced for XHCI support.\r
+ // Then its max supported devices are 256.\r
+ //\r
+ mMaxUsbDeviceNum = 256;\r
+ }\r
+ }\r
+\r
UsbHcReset (UsbBus, EFI_USB_HC_RESET_GLOBAL);\r
UsbHcSetState (UsbBus, EfiUsbHcStateOperational);\r
\r
RootHub->Bus = UsbBus;\r
RootHub->NumOfInterface = 1;\r
RootHub->Interfaces[0] = RootIf;\r
+ RootHub->Tier = 0;\r
RootIf->Signature = USB_INTERFACE_SIGNATURE;\r
RootIf->Device = RootHub;\r
RootIf->DevicePath = UsbBus->DevicePath;\r
\r
mUsbRootHubApi.Release (RootIf);\r
\r
- for (Index = 1; Index < USB_MAX_DEVICES; Index++) {\r
+ for (Index = 1; Index < mMaxUsbDeviceNum; Index++) {\r
if (Bus->Devices[Index] != NULL) {\r
UsbRemoveDevice (Bus->Devices[Index]);\r
}\r