\r
Usb Bus Driver Binding and Bus IO Protocol.\r
\r
-Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
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
\r
@param This The USB IO instance.\r
@param LangIDTable The table to return the language IDs.\r
- @param TableSize The number of supported languanges.\r
+ @param TableSize The size, in bytes, of the table LangIDTable.\r
\r
@retval EFI_SUCCESS The language ID is return.\r
\r
Dev = UsbIf->Device;\r
\r
*LangIDTable = Dev->LangId;\r
- *TableSize = Dev->TotalLangId;\r
+ *TableSize = (UINT16) (Dev->TotalLangId * sizeof (UINT16));\r
\r
gBS->RestoreTPL (OldTpl);\r
return EFI_SUCCESS;\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
// If first start, build the bus execute environment and install bus protocol\r
//\r
+ REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_IO_BUS_USB | EFI_P_PC_ENABLE));\r
Status = UsbBusBuildProtocol (This, Controller, RemainingDevicePath);\r
if (EFI_ERROR (Status)) {\r
return Status;\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