\r
#include "Ehci.h"\r
\r
-//\r
-// EFI Component Name Functions\r
-//\r
-/**\r
- Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
- This function retrieves the user readable name of a driver in the form of a\r
- Unicode string. If the driver specified by This has a user readable name in\r
- the language specified by Language, then a pointer to the driver name is\r
- returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
- by This does not support the language specified by Language,\r
- then EFI_UNSUPPORTED is returned.\r
-\r
- @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
- EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
- @param Language[in] A pointer to a Null-terminated ASCII string\r
- array indicating the language. This is the\r
- language of the driver name that the caller is\r
- requesting, and it must match one of the\r
- languages specified in SupportedLanguages. The\r
- number of languages supported by a driver is up\r
- to the driver writer. Language is specified\r
- in RFC 3066 or ISO 639-2 language code format.\r
-\r
- @param DriverName[out] A pointer to the Unicode string to return.\r
- This Unicode string is the name of the\r
- driver specified by This in the language\r
- specified by Language.\r
-\r
- @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
- This and the language specified by Language was\r
- returned in DriverName.\r
-\r
- @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
- @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
- @retval EFI_UNSUPPORTED The driver specified by This does not support\r
- the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EhciComponentNameGetDriverName (\r
- IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
- IN CHAR8 *Language,\r
- OUT CHAR16 **DriverName\r
- );\r
-\r
-\r
-/**\r
- Retrieves a Unicode string that is the user readable name of the controller\r
- that is being managed by a driver.\r
-\r
- This function retrieves the user readable name of the controller specified by\r
- ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
- driver specified by This has a user readable name in the language specified by\r
- Language, then a pointer to the controller name is returned in ControllerName,\r
- and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
- managing the controller specified by ControllerHandle and ChildHandle,\r
- then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
- support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
- @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
- EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
- @param ControllerHandle[in] The handle of a controller that the driver\r
- specified by This is managing. This handle\r
- specifies the controller whose name is to be\r
- returned.\r
-\r
- @param ChildHandle[in] The handle of the child controller to retrieve\r
- the name of. This is an optional parameter that\r
- may be NULL. It will be NULL for device\r
- drivers. It will also be NULL for a bus drivers\r
- that wish to retrieve the name of the bus\r
- controller. It will not be NULL for a bus\r
- driver that wishes to retrieve the name of a\r
- child controller.\r
-\r
- @param Language[in] A pointer to a Null-terminated ASCII string\r
- array indicating the language. This is the\r
- language of the driver name that the caller is\r
- requesting, and it must match one of the\r
- languages specified in SupportedLanguages. The\r
- number of languages supported by a driver is up\r
- to the driver writer. Language is specified in\r
- RFC 3066 or ISO 639-2 language code format.\r
-\r
- @param ControllerName[out] A pointer to the Unicode string to return.\r
- This Unicode string is the name of the\r
- controller specified by ControllerHandle and\r
- ChildHandle in the language specified by\r
- Language from the point of view of the driver\r
- specified by This.\r
-\r
- @retval EFI_SUCCESS The Unicode string for the user readable name in\r
- the language specified by Language for the\r
- driver specified by This was returned in\r
- DriverName.\r
-\r
- @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
- @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
- EFI_HANDLE.\r
-\r
- @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
- @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
- @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
- managing the controller specified by\r
- ControllerHandle and ChildHandle.\r
-\r
- @retval EFI_UNSUPPORTED The driver specified by This does not support\r
- the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EhciComponentNameGetControllerName (\r
- IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
- IN EFI_HANDLE ControllerHandle,\r
- IN EFI_HANDLE ChildHandle OPTIONAL,\r
- IN CHAR8 *Language,\r
- OUT CHAR16 **ControllerName\r
- );\r
-\r
\r
//\r
// EFI Component Name Protocol\r
{ NULL , NULL }\r
};\r
\r
+\r
/**\r
Retrieves a Unicode string that is the user readable name of the driver.\r
\r
--- /dev/null
+/** @file\r
+\r
+ This file contains the delarations for componet name routines.\r
+\r
+Copyright (c) 2008, Intel Corporation\r
+All rights reserved. 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
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef _COMPONENT_NAME_H_\r
+#define _COMPONENT_NAME_H_\r
+\r
+\r
+/**\r
+ Retrieves a Unicode string that is the user readable name of the driver.\r
+\r
+ This function retrieves the user readable name of a driver in the form of a\r
+ Unicode string. If the driver specified by This has a user readable name in\r
+ the language specified by Language, then a pointer to the driver name is\r
+ returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
+ by This does not support the language specified by Language,\r
+ then EFI_UNSUPPORTED is returned.\r
+\r
+ @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
+ EFI_COMPONENT_NAME_PROTOCOL instance.\r
+\r
+ @param Language[in] A pointer to a Null-terminated ASCII string\r
+ array indicating the language. This is the\r
+ language of the driver name that the caller is\r
+ requesting, and it must match one of the\r
+ languages specified in SupportedLanguages. The\r
+ number of languages supported by a driver is up\r
+ to the driver writer. Language is specified\r
+ in RFC 3066 or ISO 639-2 language code format.\r
+\r
+ @param DriverName[out] A pointer to the Unicode string to return.\r
+ This Unicode string is the name of the\r
+ driver specified by This in the language\r
+ specified by Language.\r
+\r
+ @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
+ This and the language specified by Language was\r
+ returned in DriverName.\r
+\r
+ @retval EFI_INVALID_PARAMETER Language is NULL.\r
+\r
+ @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
+\r
+ @retval EFI_UNSUPPORTED The driver specified by This does not support\r
+ the language specified by Language.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EhciComponentNameGetDriverName (\r
+ IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
+ IN CHAR8 *Language,\r
+ OUT CHAR16 **DriverName\r
+ );\r
+\r
+\r
+/**\r
+ Retrieves a Unicode string that is the user readable name of the controller\r
+ that is being managed by a driver.\r
+\r
+ This function retrieves the user readable name of the controller specified by\r
+ ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
+ driver specified by This has a user readable name in the language specified by\r
+ Language, then a pointer to the controller name is returned in ControllerName,\r
+ and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
+ managing the controller specified by ControllerHandle and ChildHandle,\r
+ then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
+ support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
+\r
+ @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
+ EFI_COMPONENT_NAME_PROTOCOL instance.\r
+\r
+ @param ControllerHandle[in] The handle of a controller that the driver\r
+ specified by This is managing. This handle\r
+ specifies the controller whose name is to be\r
+ returned.\r
+\r
+ @param ChildHandle[in] The handle of the child controller to retrieve\r
+ the name of. This is an optional parameter that\r
+ may be NULL. It will be NULL for device\r
+ drivers. It will also be NULL for a bus drivers\r
+ that wish to retrieve the name of the bus\r
+ controller. It will not be NULL for a bus\r
+ driver that wishes to retrieve the name of a\r
+ child controller.\r
+\r
+ @param Language[in] A pointer to a Null-terminated ASCII string\r
+ array indicating the language. This is the\r
+ language of the driver name that the caller is\r
+ requesting, and it must match one of the\r
+ languages specified in SupportedLanguages. The\r
+ number of languages supported by a driver is up\r
+ to the driver writer. Language is specified in\r
+ RFC 3066 or ISO 639-2 language code format.\r
+\r
+ @param ControllerName[out] A pointer to the Unicode string to return.\r
+ This Unicode string is the name of the\r
+ controller specified by ControllerHandle and\r
+ ChildHandle in the language specified by\r
+ Language from the point of view of the driver\r
+ specified by This.\r
+\r
+ @retval EFI_SUCCESS The Unicode string for the user readable name in\r
+ the language specified by Language for the\r
+ driver specified by This was returned in\r
+ DriverName.\r
+\r
+ @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+\r
+ @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
+ EFI_HANDLE.\r
+\r
+ @retval EFI_INVALID_PARAMETER Language is NULL.\r
+\r
+ @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
+\r
+ @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
+ managing the controller specified by\r
+ ControllerHandle and ChildHandle.\r
+\r
+ @retval EFI_UNSUPPORTED The driver specified by This does not support\r
+ the language specified by Language.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EhciComponentNameGetControllerName (\r
+ IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
+ IN EFI_HANDLE ControllerHandle,\r
+ IN EFI_HANDLE ChildHandle OPTIONAL,\r
+ IN CHAR8 *Language,\r
+ OUT CHAR16 **ControllerName\r
+ );\r
+\r
+#endif\r
+\r
{PORTSC_OVERCUR_CHANGE, USB_PORT_STAT_C_OVERCURRENT}\r
};\r
\r
+EFI_DRIVER_BINDING_PROTOCOL\r
+gEhciDriverBinding = {\r
+ EhcDriverBindingSupported,\r
+ EhcDriverBindingStart,\r
+ EhcDriverBindingStop,\r
+ 0x10,\r
+ NULL,\r
+ NULL\r
+};\r
\r
/**\r
Retrieves the capablility of root hub ports.\r
return EFI_SUCCESS;\r
}\r
\r
-EFI_DRIVER_BINDING_PROTOCOL\r
-gEhciDriverBinding = {\r
- EhcDriverBindingSupported,\r
- EhcDriverBindingStart,\r
- EhcDriverBindingStop,\r
- 0x10,\r
- NULL,\r
- NULL\r
-};\r
#include "EhciUrb.h"\r
#include "EhciSched.h"\r
#include "EhciDebug.h"\r
+#include "ComponentName.h"\r
\r
typedef enum {\r
EHC_1_MICROSECOND = 1,\r
extern EFI_COMPONENT_NAME_PROTOCOL gEhciComponentName;\r
extern EFI_COMPONENT_NAME2_PROTOCOL gEhciComponentName2;\r
\r
+/**\r
+ Test to see if this driver supports ControllerHandle. Any\r
+ ControllerHandle that has Usb2HcProtocol installed will\r
+ be supported.\r
+\r
+ @param This Protocol instance pointer.\r
+ @param Controller Handle of device to test.\r
+ @param RemainingDevicePath Not used.\r
+\r
+ @return EFI_SUCCESS This driver supports this device.\r
+ @return EFI_UNSUPPORTED This driver does not support this device.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EhcDriverBindingSupported (\r
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
+ IN EFI_HANDLE Controller,\r
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
+ );\r
+\r
+/**\r
+ Starting the Usb EHCI Driver.\r
+\r
+ @param This Protocol instance pointer.\r
+ @param Controller Handle of device to test.\r
+ @param RemainingDevicePath Not used.\r
+\r
+ @return EFI_SUCCESS supports this device.\r
+ @return EFI_UNSUPPORTED do not support this device.\r
+ @return EFI_DEVICE_ERROR cannot be started due to device Error.\r
+ @return EFI_OUT_OF_RESOURCES cannot allocate resources.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EhcDriverBindingStart (\r
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
+ IN EFI_HANDLE Controller,\r
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
+ );\r
+\r
+/**\r
+ Stop this driver on ControllerHandle. Support stoping any child handles\r
+ created by this driver.\r
+\r
+ @param This Protocol instance pointer.\r
+ @param Controller Handle of device to stop driver on.\r
+ @param NumberOfChildren Number of Children in the ChildHandleBuffer.\r
+ @param ChildHandleBuffer List of handles for the children we need to stop.\r
+\r
+ @return EFI_SUCCESS Success.\r
+ @return EFI_DEVICE_ERROR Fail.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EhcDriverBindingStop (\r
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
+ IN EFI_HANDLE Controller,\r
+ IN UINTN NumberOfChildren,\r
+ IN EFI_HANDLE *ChildHandleBuffer\r
+ );\r
+\r
#endif\r
+\r
EhciReg.c\r
EhciDebug.h\r
ComponentName.c\r
+ ComponentName.h\r
EhciUrb.h\r
Ehci.h\r
EhciSched.h\r
\r
#include "Uhci.h"\r
\r
-//\r
-// EFI Component Name Functions\r
-//\r
-/**\r
- Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
- This function retrieves the user readable name of a driver in the form of a\r
- Unicode string. If the driver specified by This has a user readable name in\r
- the language specified by Language, then a pointer to the driver name is\r
- returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
- by This does not support the language specified by Language,\r
- then EFI_UNSUPPORTED is returned.\r
-\r
- @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
- EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
- @param Language[in] A pointer to a Null-terminated ASCII string\r
- array indicating the language. This is the\r
- language of the driver name that the caller is\r
- requesting, and it must match one of the\r
- languages specified in SupportedLanguages. The\r
- number of languages supported by a driver is up\r
- to the driver writer. Language is specified\r
- in RFC 3066 or ISO 639-2 language code format.\r
-\r
- @param DriverName[out] A pointer to the Unicode string to return.\r
- This Unicode string is the name of the\r
- driver specified by This in the language\r
- specified by Language.\r
-\r
- @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
- This and the language specified by Language was\r
- returned in DriverName.\r
-\r
- @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
- @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
- @retval EFI_UNSUPPORTED The driver specified by This does not support\r
- the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UhciComponentNameGetDriverName (\r
- IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
- IN CHAR8 *Language,\r
- OUT CHAR16 **DriverName\r
- );\r
-\r
-\r
-/**\r
- Retrieves a Unicode string that is the user readable name of the controller\r
- that is being managed by a driver.\r
-\r
- This function retrieves the user readable name of the controller specified by\r
- ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
- driver specified by This has a user readable name in the language specified by\r
- Language, then a pointer to the controller name is returned in ControllerName,\r
- and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
- managing the controller specified by ControllerHandle and ChildHandle,\r
- then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
- support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
- @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
- EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
- @param ControllerHandle[in] The handle of a controller that the driver\r
- specified by This is managing. This handle\r
- specifies the controller whose name is to be\r
- returned.\r
-\r
- @param ChildHandle[in] The handle of the child controller to retrieve\r
- the name of. This is an optional parameter that\r
- may be NULL. It will be NULL for device\r
- drivers. It will also be NULL for a bus drivers\r
- that wish to retrieve the name of the bus\r
- controller. It will not be NULL for a bus\r
- driver that wishes to retrieve the name of a\r
- child controller.\r
-\r
- @param Language[in] A pointer to a Null-terminated ASCII string\r
- array indicating the language. This is the\r
- language of the driver name that the caller is\r
- requesting, and it must match one of the\r
- languages specified in SupportedLanguages. The\r
- number of languages supported by a driver is up\r
- to the driver writer. Language is specified in\r
- RFC 3066 or ISO 639-2 language code format.\r
-\r
- @param ControllerName[out] A pointer to the Unicode string to return.\r
- This Unicode string is the name of the\r
- controller specified by ControllerHandle and\r
- ChildHandle in the language specified by\r
- Language from the point of view of the driver\r
- specified by This.\r
-\r
- @retval EFI_SUCCESS The Unicode string for the user readable name in\r
- the language specified by Language for the\r
- driver specified by This was returned in\r
- DriverName.\r
-\r
- @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
- @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
- EFI_HANDLE.\r
-\r
- @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
- @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
- @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
- managing the controller specified by\r
- ControllerHandle and ChildHandle.\r
-\r
- @retval EFI_UNSUPPORTED The driver specified by This does not support\r
- the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UhciComponentNameGetControllerName (\r
- IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
- IN EFI_HANDLE ControllerHandle,\r
- IN EFI_HANDLE ChildHandle OPTIONAL,\r
- IN CHAR8 *Language,\r
- OUT CHAR16 **ControllerName\r
- );\r
-\r
\r
//\r
// EFI Component Name Protocol\r
//\r
+\r
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gUhciComponentName = {\r
UhciComponentNameGetDriverName,\r
UhciComponentNameGetControllerName,\r
{ NULL, NULL }\r
};\r
\r
+\r
+//\r
+// EFI Component Name Functions\r
+//\r
+\r
/**\r
Retrieves a Unicode string that is the user readable name of the driver.\r
\r
--- /dev/null
+/** @file\r
+\r
+ This file contains the delarations for componet name routines.\r
+\r
+Copyright (c) 2008, Intel Corporation\r
+All rights reserved. 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
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef _COMPONENT_NAME_H_\r
+#define _COMPONENT_NAME_H_\r
+\r
+/**\r
+ Retrieves a Unicode string that is the user readable name of the driver.\r
+\r
+ This function retrieves the user readable name of a driver in the form of a\r
+ Unicode string. If the driver specified by This has a user readable name in\r
+ the language specified by Language, then a pointer to the driver name is\r
+ returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
+ by This does not support the language specified by Language,\r
+ then EFI_UNSUPPORTED is returned.\r
+\r
+ @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
+ EFI_COMPONENT_NAME_PROTOCOL instance.\r
+\r
+ @param Language[in] A pointer to a Null-terminated ASCII string\r
+ array indicating the language. This is the\r
+ language of the driver name that the caller is\r
+ requesting, and it must match one of the\r
+ languages specified in SupportedLanguages. The\r
+ number of languages supported by a driver is up\r
+ to the driver writer. Language is specified\r
+ in RFC 3066 or ISO 639-2 language code format.\r
+\r
+ @param DriverName[out] A pointer to the Unicode string to return.\r
+ This Unicode string is the name of the\r
+ driver specified by This in the language\r
+ specified by Language.\r
+\r
+ @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
+ This and the language specified by Language was\r
+ returned in DriverName.\r
+\r
+ @retval EFI_INVALID_PARAMETER Language is NULL.\r
+\r
+ @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
+\r
+ @retval EFI_UNSUPPORTED The driver specified by This does not support\r
+ the language specified by Language.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UhciComponentNameGetDriverName (\r
+ IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
+ IN CHAR8 *Language,\r
+ OUT CHAR16 **DriverName\r
+ );\r
+\r
+\r
+/**\r
+ Retrieves a Unicode string that is the user readable name of the controller\r
+ that is being managed by a driver.\r
+\r
+ This function retrieves the user readable name of the controller specified by\r
+ ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
+ driver specified by This has a user readable name in the language specified by\r
+ Language, then a pointer to the controller name is returned in ControllerName,\r
+ and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
+ managing the controller specified by ControllerHandle and ChildHandle,\r
+ then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
+ support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
+\r
+ @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
+ EFI_COMPONENT_NAME_PROTOCOL instance.\r
+\r
+ @param ControllerHandle[in] The handle of a controller that the driver\r
+ specified by This is managing. This handle\r
+ specifies the controller whose name is to be\r
+ returned.\r
+\r
+ @param ChildHandle[in] The handle of the child controller to retrieve\r
+ the name of. This is an optional parameter that\r
+ may be NULL. It will be NULL for device\r
+ drivers. It will also be NULL for a bus drivers\r
+ that wish to retrieve the name of the bus\r
+ controller. It will not be NULL for a bus\r
+ driver that wishes to retrieve the name of a\r
+ child controller.\r
+\r
+ @param Language[in] A pointer to a Null-terminated ASCII string\r
+ array indicating the language. This is the\r
+ language of the driver name that the caller is\r
+ requesting, and it must match one of the\r
+ languages specified in SupportedLanguages. The\r
+ number of languages supported by a driver is up\r
+ to the driver writer. Language is specified in\r
+ RFC 3066 or ISO 639-2 language code format.\r
+\r
+ @param ControllerName[out] A pointer to the Unicode string to return.\r
+ This Unicode string is the name of the\r
+ controller specified by ControllerHandle and\r
+ ChildHandle in the language specified by\r
+ Language from the point of view of the driver\r
+ specified by This.\r
+\r
+ @retval EFI_SUCCESS The Unicode string for the user readable name in\r
+ the language specified by Language for the\r
+ driver specified by This was returned in\r
+ DriverName.\r
+\r
+ @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+\r
+ @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
+ EFI_HANDLE.\r
+\r
+ @retval EFI_INVALID_PARAMETER Language is NULL.\r
+\r
+ @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
+\r
+ @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
+ managing the controller specified by\r
+ ControllerHandle and ChildHandle.\r
+\r
+ @retval EFI_UNSUPPORTED The driver specified by This does not support\r
+ the language specified by Language.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UhciComponentNameGetControllerName (\r
+ IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
+ IN EFI_HANDLE ControllerHandle,\r
+ IN EFI_HANDLE ChildHandle OPTIONAL,\r
+ IN CHAR8 *Language,\r
+ OUT CHAR16 **ControllerName\r
+ );\r
+\r
+#endif\r
\r
#include "Uhci.h"\r
\r
+\r
+EFI_DRIVER_BINDING_PROTOCOL gUhciDriverBinding = {\r
+ UhciDriverBindingSupported,\r
+ UhciDriverBindingStart,\r
+ UhciDriverBindingStop,\r
+ 0x20,\r
+ NULL,\r
+ NULL\r
+};\r
+\r
/**\r
Provides software reset for the USB host controller according to UEFI 2.0 spec.\r
\r
return EFI_SUCCESS;\r
}\r
\r
-EFI_DRIVER_BINDING_PROTOCOL gUhciDriverBinding = {\r
- UhciDriverBindingSupported,\r
- UhciDriverBindingStart,\r
- UhciDriverBindingStop,\r
- 0x20,\r
- NULL,\r
- NULL\r
-};\r
#include "UhciReg.h"\r
#include "UhciSched.h"\r
#include "UhciDebug.h"\r
+#include "ComponentName.h"\r
\r
typedef enum {\r
UHC_1_MICROSECOND = 1,\r
extern EFI_COMPONENT_NAME_PROTOCOL gUhciComponentName;\r
extern EFI_COMPONENT_NAME2_PROTOCOL gUhciComponentName2;\r
\r
+/**\r
+ Test to see if this driver supports ControllerHandle. Any\r
+ ControllerHandle that has UsbHcProtocol installed will be supported.\r
+\r
+ @param This Protocol instance pointer.\r
+ @param Controller Handle of device to test.\r
+ @param RemainingDevicePath Not used.\r
+\r
+ @return EFI_SUCCESS This driver supports this device.\r
+ @return EFI_UNSUPPORTED This driver does not support this device.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UhciDriverBindingSupported (\r
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
+ IN EFI_HANDLE Controller,\r
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
+ );\r
+\r
+/**\r
+ Starting the Usb UHCI Driver.\r
+\r
+ @param This Protocol instance pointer.\r
+ @param Controller Handle of device to test.\r
+ @param RemainingDevicePath Not used.\r
+\r
+ @retval EFI_SUCCESS This driver supports this device.\r
+ @retval EFI_UNSUPPORTED This driver does not support this device.\r
+ @retval EFI_DEVICE_ERROR This driver cannot be started due to device Error.\r
+ EFI_OUT_OF_RESOURCES- Failed due to resource shortage.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UhciDriverBindingStart (\r
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
+ IN EFI_HANDLE Controller,\r
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
+ );\r
+\r
+/**\r
+ Stop this driver on ControllerHandle. Support stoping any child handles\r
+ created by this driver.\r
+\r
+ @param This Protocol instance pointer.\r
+ @param Controller Handle of device to stop driver on.\r
+ @param NumberOfChildren Number of Children in the ChildHandleBuffer.\r
+ @param ChildHandleBuffer List of handles for the children we need to stop.\r
+\r
+ @return EFI_SUCCESS\r
+ @return others\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UhciDriverBindingStop (\r
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
+ IN EFI_HANDLE Controller,\r
+ IN UINTN NumberOfChildren,\r
+ IN EFI_HANDLE *ChildHandleBuffer\r
+ );\r
+\r
#endif\r
**/\r
\r
#include "Uhci.h"\r
-#include "UhciDebug.h"\r
-\r
\r
/**\r
Dump the content of QH structure.\r
UhciReg.h\r
UhciSched.h\r
ComponentName.c\r
+ ComponentName.h\r
\r
\r
[Packages]\r
UNDI32_DEV *UNDI32DeviceList[MAX_NIC_INTERFACES];\r
NII_TABLE *UndiDataPointer = NULL;\r
\r
+//\r
+// UNDI Class Driver Global Variables\r
+//\r
+EFI_DRIVER_BINDING_PROTOCOL gUndiDriverBinding = {\r
+ UndiDriverSupported,\r
+ UndiDriverStart,\r
+ UndiDriverStop,\r
+ 0xa,\r
+ NULL,\r
+ NULL\r
+};\r
+\r
\r
/**\r
When address mapping changes to virtual this should make the appropriate\r
@return None\r
\r
**/\r
-// TODO: Context - add argument and description to function comment\r
VOID\r
EFIAPI\r
UndiNotifyVirtual (\r
@return None\r
\r
**/\r
-// TODO: Context - add argument and description to function comment\r
VOID\r
EFIAPI\r
UndiNotifyExitBs (\r
{\r
InstallConfigTable ();\r
}\r
-//\r
-// UNDI Class Driver Global Variables\r
-//\r
-EFI_DRIVER_BINDING_PROTOCOL gUndiDriverBinding = {\r
- UndiDriverSupported,\r
- UndiDriverStart,\r
- UndiDriverStop,\r
- 0xa,\r
- NULL,\r
- NULL\r
-};\r
-\r
\r
\r
/**\r
//\r
EFI_GUID mUsbBusProtocolGuid = EFI_USB_BUS_PROTOCOL_GUID;\r
\r
+EFI_USB_IO_PROTOCOL mUsbIoProtocol = {\r
+ UsbIoControlTransfer,\r
+ UsbIoBulkTransfer,\r
+ UsbIoAsyncInterruptTransfer,\r
+ UsbIoSyncInterruptTransfer,\r
+ UsbIoIsochronousTransfer,\r
+ UsbIoAsyncIsochronousTransfer,\r
+ UsbIoGetDeviceDescriptor,\r
+ UsbIoGetActiveConfigDescriptor,\r
+ UsbIoGetInterfaceDescriptor,\r
+ UsbIoGetEndpointDescriptor,\r
+ UsbIoGetStringDescriptor,\r
+ UsbIoGetSupportedLanguages,\r
+ UsbIoPortReset\r
+};\r
+\r
+EFI_DRIVER_BINDING_PROTOCOL mUsbBusDriverBinding = {\r
+ UsbBusControllerDriverSupported,\r
+ UsbBusControllerDriverStart,\r
+ UsbBusControllerDriverStop,\r
+ 0xa,\r
+ NULL,\r
+ NULL\r
+};\r
+\r
\r
/**\r
USB_IO function to execute a control transfer. This\r
return Status;\r
}\r
\r
-EFI_USB_IO_PROTOCOL mUsbIoProtocol = {\r
- UsbIoControlTransfer,\r
- UsbIoBulkTransfer,\r
- UsbIoAsyncInterruptTransfer,\r
- UsbIoSyncInterruptTransfer,\r
- UsbIoIsochronousTransfer,\r
- UsbIoAsyncIsochronousTransfer,\r
- UsbIoGetDeviceDescriptor,\r
- UsbIoGetActiveConfigDescriptor,\r
- UsbIoGetInterfaceDescriptor,\r
- UsbIoGetEndpointDescriptor,\r
- UsbIoGetStringDescriptor,\r
- UsbIoGetSupportedLanguages,\r
- UsbIoPortReset\r
-};\r
-\r
\r
/**\r
The USB bus driver entry pointer.\r
\r
return Status;\r
}\r
-\r
-EFI_DRIVER_BINDING_PROTOCOL mUsbBusDriverBinding = {\r
- UsbBusControllerDriverSupported,\r
- UsbBusControllerDriverStart,\r
- UsbBusControllerDriverStop,\r
- 0xa,\r
- NULL,\r
- NULL\r
-};\r
IN EFI_USB_BUS_PROTOCOL *UsbBusId\r
);\r
\r
+/**\r
+ USB_IO function to execute a control transfer. This\r
+ function will execute the USB transfer. If transfer\r
+ successes, it will sync the internal state of USB bus\r
+ with device state.\r
+\r
+ @param This The USB_IO instance\r
+ @param Request The control transfer request\r
+ @param Direction Direction for data stage\r
+ @param Timeout The time to wait before timeout\r
+ @param Data The buffer holding the data\r
+ @param DataLength Then length of the data\r
+ @param UsbStatus USB result\r
+\r
+ @retval EFI_INVALID_PARAMETER The parameters are invalid\r
+ @retval EFI_SUCCESS The control transfer succeded.\r
+ @retval Others Failed to execute the transfer\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoControlTransfer (\r
+ IN EFI_USB_IO_PROTOCOL *This,\r
+ IN EFI_USB_DEVICE_REQUEST *Request,\r
+ IN EFI_USB_DATA_DIRECTION Direction,\r
+ IN UINT32 Timeout,\r
+ IN OUT VOID *Data, OPTIONAL\r
+ IN UINTN DataLength, OPTIONAL\r
+ OUT UINT32 *UsbStatus\r
+ );\r
+\r
+/**\r
+ Execute a bulk transfer to the device endpoint.\r
+\r
+ @param This The USB IO instance.\r
+ @param Endpoint The device endpoint.\r
+ @param Data The data to transfer.\r
+ @param DataLength The length of the data to transfer.\r
+ @param Timeout Time to wait before timeout.\r
+ @param UsbStatus The result of USB transfer.\r
+\r
+ @retval EFI_SUCCESS The bulk transfer is OK.\r
+ @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
+ @retval Others Failed to execute transfer, reason returned in\r
+ UsbStatus.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoBulkTransfer (\r
+ IN EFI_USB_IO_PROTOCOL *This,\r
+ IN UINT8 Endpoint,\r
+ IN OUT VOID *Data,\r
+ IN OUT UINTN *DataLength,\r
+ IN UINTN Timeout,\r
+ OUT UINT32 *UsbStatus\r
+ );\r
+\r
+/**\r
+ Execute a synchronous interrupt transfer.\r
+\r
+ @param This The USB IO instance.\r
+ @param Endpoint The device endpoint.\r
+ @param Data The data to transfer.\r
+ @param DataLength The length of the data to transfer.\r
+ @param Timeout Time to wait before timeout.\r
+ @param UsbStatus The result of USB transfer.\r
+\r
+ @retval EFI_SUCCESS The synchronous interrupt transfer is OK.\r
+ @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
+ @retval Others Failed to execute transfer, reason returned in\r
+ UsbStatus.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoSyncInterruptTransfer (\r
+ IN EFI_USB_IO_PROTOCOL *This,\r
+ IN UINT8 Endpoint,\r
+ IN OUT VOID *Data,\r
+ IN OUT UINTN *DataLength,\r
+ IN UINTN Timeout,\r
+ OUT UINT32 *UsbStatus\r
+ );\r
+\r
+/**\r
+ Queue a new asynchronous interrupt transfer, or remove the old\r
+ request if (IsNewTransfer == FALSE).\r
+\r
+ @param This The USB_IO instance.\r
+ @param Endpoint The device endpoint.\r
+ @param IsNewTransfer Whether this is a new request, if it's old, remove\r
+ the request.\r
+ @param PollInterval The interval to poll the transfer result, (in ms).\r
+ @param DataLength The length of perodic data transfer.\r
+ @param Callback The function to call periodicaly when transfer is\r
+ ready.\r
+ @param Context The context to the callback.\r
+\r
+ @retval EFI_SUCCESS New transfer is queued or old request is removed.\r
+ @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
+ @retval Others Failed to queue the new request or remove the old\r
+ request.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoAsyncInterruptTransfer (\r
+ IN EFI_USB_IO_PROTOCOL *This,\r
+ IN UINT8 Endpoint,\r
+ IN BOOLEAN IsNewTransfer,\r
+ IN UINTN PollInterval, OPTIONAL\r
+ IN UINTN DataLength, OPTIONAL\r
+ IN EFI_ASYNC_USB_TRANSFER_CALLBACK Callback, OPTIONAL\r
+ IN VOID *Context OPTIONAL\r
+ );\r
+\r
+/**\r
+ Execute a synchronous isochronous transfer.\r
+\r
+ @param This The USB IO instance.\r
+ @param DeviceEndpoint The device endpoint.\r
+ @param Data The data to transfer.\r
+ @param DataLength The length of the data to transfer.\r
+ @param UsbStatus The result of USB transfer.\r
+\r
+ @retval EFI_UNSUPPORTED Currently isochronous transfer isn't supported.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoIsochronousTransfer (\r
+ IN EFI_USB_IO_PROTOCOL *This,\r
+ IN UINT8 DeviceEndpoint,\r
+ IN OUT VOID *Data,\r
+ IN UINTN DataLength,\r
+ OUT UINT32 *Status\r
+ );\r
+\r
+/**\r
+ Queue an asynchronous isochronous transfer.\r
+\r
+ @param This The USB_IO instance.\r
+ @param DeviceEndpoint The device endpoint.\r
+ @param Data The data to transfer.\r
+ @param DataLength The length of perodic data transfer.\r
+ @param IsochronousCallBack The function to call periodicaly when transfer is\r
+ ready.\r
+ @param Context The context to the callback.\r
+\r
+ @retval EFI_UNSUPPORTED Currently isochronous transfer isn't supported.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoAsyncIsochronousTransfer (\r
+ IN EFI_USB_IO_PROTOCOL *This,\r
+ IN UINT8 DeviceEndpoint,\r
+ IN OUT VOID *Data,\r
+ IN UINTN DataLength,\r
+ IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,\r
+ IN VOID *Context OPTIONAL\r
+ );\r
+\r
+/**\r
+ Retrieve the device descriptor of the device.\r
+\r
+ @param This The USB IO instance.\r
+ @param Descriptor The variable to receive the device descriptor.\r
+\r
+ @retval EFI_SUCCESS The device descriptor is returned.\r
+ @retval EFI_INVALID_PARAMETER The parameter is invalid.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoGetDeviceDescriptor (\r
+ IN EFI_USB_IO_PROTOCOL *This,\r
+ OUT EFI_USB_DEVICE_DESCRIPTOR *Descriptor\r
+ );\r
+\r
+/**\r
+ Return the configuration descriptor of the current active configuration.\r
+\r
+ @param This The USB IO instance.\r
+ @param Descriptor The USB configuration descriptor.\r
+\r
+ @retval EFI_SUCCESS The active configuration descriptor is returned.\r
+ @retval EFI_INVALID_PARAMETER Some parameter is invalid.\r
+ @retval EFI_NOT_FOUND Currently no active configuration is selected.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoGetActiveConfigDescriptor (\r
+ IN EFI_USB_IO_PROTOCOL *This,\r
+ OUT EFI_USB_CONFIG_DESCRIPTOR *Descriptor\r
+ );\r
+\r
+/**\r
+ Retrieve the active interface setting descriptor for this USB IO instance.\r
+\r
+ @param This The USB IO instance.\r
+ @param Descriptor The variable to receive active interface setting.\r
+\r
+ @retval EFI_SUCCESS The active interface setting is returned.\r
+ @retval EFI_INVALID_PARAMETER Some parameter is invalid.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoGetInterfaceDescriptor (\r
+ IN EFI_USB_IO_PROTOCOL *This,\r
+ OUT EFI_USB_INTERFACE_DESCRIPTOR *Descriptor\r
+ );\r
+\r
+/**\r
+ Retrieve the endpoint descriptor from this interface setting.\r
+\r
+ @param This The USB IO instance.\r
+ @param Index The index (start from zero) of the endpoint to\r
+ retrieve.\r
+ @param Descriptor The variable to receive the descriptor.\r
+\r
+ @retval EFI_SUCCESS The endpoint descriptor is returned.\r
+ @retval EFI_INVALID_PARAMETER Some parameter is invalid.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoGetEndpointDescriptor (\r
+ IN EFI_USB_IO_PROTOCOL *This,\r
+ IN UINT8 Index,\r
+ OUT EFI_USB_ENDPOINT_DESCRIPTOR *Descriptor\r
+ );\r
+\r
+/**\r
+ Retrieve the supported language ID table from the device.\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
+\r
+ @retval EFI_SUCCESS The language ID is return.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoGetSupportedLanguages (\r
+ IN EFI_USB_IO_PROTOCOL *This,\r
+ OUT UINT16 **LangIDTable,\r
+ OUT UINT16 *TableSize\r
+ );\r
+\r
+/**\r
+ Retrieve an indexed string in the language of LangID.\r
+\r
+ @param This The USB IO instance.\r
+ @param LangID The language ID of the string to retrieve.\r
+ @param StringIndex The index of the string.\r
+ @param String The variable to receive the string.\r
+\r
+ @retval EFI_SUCCESS The string is returned.\r
+ @retval EFI_NOT_FOUND No such string existed.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoGetStringDescriptor (\r
+ IN EFI_USB_IO_PROTOCOL *This,\r
+ IN UINT16 LangID,\r
+ IN UINT8 StringIndex,\r
+ OUT CHAR16 **String\r
+ );\r
+\r
+/**\r
+ Reset the device, then if that succeeds, reconfigure the\r
+ device with its address and current active configuration.\r
+\r
+ @param This The USB IO instance.\r
+\r
+ @retval EFI_SUCCESS The device is reset and configured.\r
+ @retval Others Failed to reset the device.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbIoPortReset (\r
+ IN EFI_USB_IO_PROTOCOL *This\r
+ );\r
+\r
+/**\r
+ Install Usb Bus Protocol on host controller, and start the Usb bus.\r
+\r
+ @param This The USB bus driver binding instance.\r
+ @param Controller The controller to check.\r
+ @param RemainingDevicePath The remaining device patch.\r
+\r
+ @retval EFI_SUCCESS The controller is controlled by the usb bus.\r
+ @retval EFI_ALREADY_STARTED The controller is already controlled by the usb bus.\r
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate resources.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbBusBuildProtocol (\r
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
+ IN EFI_HANDLE Controller,\r
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
+ );\r
+\r
+/**\r
+ The USB bus driver entry pointer.\r
+\r
+ @param ImageHandle The driver image handle.\r
+ @param SystemTable The system table.\r
+\r
+ @return EFI_SUCCESS The component name protocol is installed.\r
+ @return Others Failed to init the usb driver.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbBusDriverEntryPoint (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
+ );\r
+\r
+/**\r
+ Check whether USB bus driver support this device.\r
+\r
+ @param This The USB bus driver binding protocol.\r
+ @param Controller The controller handle to check.\r
+ @param RemainingDevicePath The remaining device path.\r
+\r
+ @retval EFI_SUCCESS The bus supports this controller.\r
+ @retval EFI_UNSUPPORTED This device isn't supported.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbBusControllerDriverSupported (\r
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
+ IN EFI_HANDLE Controller,\r
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
+ );\r
+\r
+/**\r
+ Start to process the controller.\r
+\r
+ @param This The USB bus driver binding instance.\r
+ @param Controller The controller to check.\r
+ @param RemainingDevicePath The remaining device patch.\r
+\r
+ @retval EFI_SUCCESS The controller is controlled by the usb bus.\r
+ @retval EFI_ALREADY_STARTED The controller is already controlled by the usb\r
+ bus.\r
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate resources.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbBusControllerDriverStart (\r
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
+ IN EFI_HANDLE Controller,\r
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
+ );\r
+\r
+/**\r
+ Stop handle the controller by this USB bus driver.\r
+\r
+ @param This The USB bus driver binding protocol.\r
+ @param Controller The controller to release.\r
+ @param NumberOfChildren The child of USB bus that opened controller\r
+ BY_CHILD.\r
+ @param ChildHandleBuffer The array of child handle.\r
+\r
+ @retval EFI_SUCCESS The controller or children are stopped.\r
+ @retval EFI_DEVICE_ERROR Failed to stop the driver.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UsbBusControllerDriverStop (\r
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
+ IN EFI_HANDLE Controller,\r
+ IN UINTN NumberOfChildren,\r
+ IN EFI_HANDLE *ChildHandleBuffer\r
+ );\r
+\r
extern EFI_USB_IO_PROTOCOL mUsbIoProtocol;\r
extern EFI_DRIVER_BINDING_PROTOCOL mUsbBusDriverBinding;\r
extern EFI_COMPONENT_NAME_PROTOCOL mUsbBusComponentName;\r
\r
#include "UsbBus.h"\r
\r
+//\r
+// Array that maps the change bit to feature value which is\r
+// used to clear these change bit. USB HUB API will clear\r
+// these change bit automatically. For non-root hub, these\r
+// bits determine whether hub will report the port in changed\r
+// bit maps.\r
+//\r
+#define USB_HUB_MAP_SIZE 5\r
+\r
+USB_CHANGE_FEATURE_MAP mHubFeatureMap[USB_HUB_MAP_SIZE] = {\r
+ {USB_PORT_STAT_C_CONNECTION, EfiUsbPortConnectChange},\r
+ {USB_PORT_STAT_C_ENABLE, EfiUsbPortEnableChange},\r
+ {USB_PORT_STAT_C_SUSPEND, EfiUsbPortSuspendChange},\r
+ {USB_PORT_STAT_C_OVERCURRENT, EfiUsbPortOverCurrentChange},\r
+ {USB_PORT_STAT_C_RESET, EfiUsbPortResetChange},\r
+};\r
+\r
+#define USB_ROOT_HUB_MAP_SIZE 5\r
+\r
+USB_CHANGE_FEATURE_MAP mRootHubFeatureMap[USB_ROOT_HUB_MAP_SIZE] = {\r
+ {USB_PORT_STAT_C_CONNECTION, EfiUsbPortConnectChange},\r
+ {USB_PORT_STAT_C_ENABLE, EfiUsbPortEnableChange},\r
+ {USB_PORT_STAT_C_SUSPEND, EfiUsbPortSuspendChange},\r
+ {USB_PORT_STAT_C_OVERCURRENT, EfiUsbPortOverCurrentChange},\r
+ {USB_PORT_STAT_C_RESET, EfiUsbPortResetChange},\r
+};\r
+\r
//\r
// USB hub class specific requests. Although USB hub\r
// is related to an interface, these requests are sent\r
return EFI_SUCCESS;\r
}\r
\r
-//\r
-// Array that maps the change bit to feature value which is\r
-// used to clear these change bit. USB HUB API will clear\r
-// these change bit automatically. For non-root hub, these\r
-// bits determine whether hub will report the port in changed\r
-// bit maps.\r
-//\r
-#define USB_HUB_MAP_SIZE 5\r
-\r
-USB_CHANGE_FEATURE_MAP mHubFeatureMap[USB_HUB_MAP_SIZE] = {\r
- {USB_PORT_STAT_C_CONNECTION, EfiUsbPortConnectChange},\r
- {USB_PORT_STAT_C_ENABLE, EfiUsbPortEnableChange},\r
- {USB_PORT_STAT_C_SUSPEND, EfiUsbPortSuspendChange},\r
- {USB_PORT_STAT_C_OVERCURRENT, EfiUsbPortOverCurrentChange},\r
- {USB_PORT_STAT_C_RESET, EfiUsbPortResetChange},\r
-};\r
-\r
-#define USB_ROOT_HUB_MAP_SIZE 5\r
-\r
-USB_CHANGE_FEATURE_MAP mRootHubFeatureMap[USB_ROOT_HUB_MAP_SIZE] = {\r
- {USB_PORT_STAT_C_CONNECTION, EfiUsbPortConnectChange},\r
- {USB_PORT_STAT_C_ENABLE, EfiUsbPortEnableChange},\r
- {USB_PORT_STAT_C_SUSPEND, EfiUsbPortSuspendChange},\r
- {USB_PORT_STAT_C_OVERCURRENT, EfiUsbPortOverCurrentChange},\r
- {USB_PORT_STAT_C_RESET, EfiUsbPortResetChange},\r
-};\r
\r
\r
\r
{EfiKeyA3, 0, 0, EFI_RIGHT_LOGO_MODIFIER, 0}, // 0xe7\r
};\r
\r
-/**\r
- Initialize KeyConvertionTable by using default keyboard layout.\r
-\r
- @param UsbKeyboardDevice The USB_KB_DEV instance.\r
- @retval None.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-LoadDefaultKeyboardLayout (\r
- IN USB_KB_DEV *UsbKeyboardDevice\r
- )\r
-{\r
- UINTN Index;\r
- EFI_KEY_DESCRIPTOR *KeyDescriptor;\r
-\r
- //\r
- // Construct KeyConvertionTable by default keyboard layout\r
- //\r
- KeyDescriptor = &UsbKeyboardDevice->KeyConvertionTable[0];\r
-\r
- for (Index = 0; Index < (USB_KEYCODE_MAX_MAKE + 8); Index++) {\r
- KeyDescriptor->Key = (EFI_KEY) KeyboardLayoutTable[Index][0];\r
- KeyDescriptor->Unicode = KeyboardLayoutTable[Index][1];\r
- KeyDescriptor->ShiftedUnicode = KeyboardLayoutTable[Index][2];\r
- KeyDescriptor->AltGrUnicode = 0;\r
- KeyDescriptor->ShiftedAltGrUnicode = 0;\r
- KeyDescriptor->Modifier = KeyboardLayoutTable[Index][3];\r
- KeyDescriptor->AffectedAttribute = KeyboardLayoutTable[Index][4];\r
-\r
- KeyDescriptor++;\r
- }\r
-}\r
-\r
//\r
// EFI_KEY to USB Scan Code convertion table\r
//\r
};\r
\r
\r
+/**\r
+ Initialize KeyConvertionTable by using default keyboard layout.\r
+\r
+ @param UsbKeyboardDevice The USB_KB_DEV instance.\r
+ @retval None.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+LoadDefaultKeyboardLayout (\r
+ IN USB_KB_DEV *UsbKeyboardDevice\r
+ )\r
+{\r
+ UINTN Index;\r
+ EFI_KEY_DESCRIPTOR *KeyDescriptor;\r
+\r
+ //\r
+ // Construct KeyConvertionTable by default keyboard layout\r
+ //\r
+ KeyDescriptor = &UsbKeyboardDevice->KeyConvertionTable[0];\r
+\r
+ for (Index = 0; Index < (USB_KEYCODE_MAX_MAKE + 8); Index++) {\r
+ KeyDescriptor->Key = (EFI_KEY) KeyboardLayoutTable[Index][0];\r
+ KeyDescriptor->Unicode = KeyboardLayoutTable[Index][1];\r
+ KeyDescriptor->ShiftedUnicode = KeyboardLayoutTable[Index][2];\r
+ KeyDescriptor->AltGrUnicode = 0;\r
+ KeyDescriptor->ShiftedAltGrUnicode = 0;\r
+ KeyDescriptor->Modifier = KeyboardLayoutTable[Index][3];\r
+ KeyDescriptor->AffectedAttribute = KeyboardLayoutTable[Index][4];\r
+\r
+ KeyDescriptor++;\r
+ }\r
+}\r
+\r
\r
/**\r
Uses USB I/O to check whether the device is a USB Keyboard device.\r
\r
#include "mousehid.h"\r
\r
-//\r
-// Prototypes\r
-// Driver model protocol interface\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-USBMouseAbsolutePointerDriverBindingEntryPoint (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-USBMouseAbsolutePointerDriverBindingSupported (\r
- IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
- IN EFI_HANDLE Controller,\r
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-USBMouseAbsolutePointerDriverBindingStart (\r
- IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
- IN EFI_HANDLE Controller,\r
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-USBMouseAbsolutePointerDriverBindingStop (\r
- IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
- IN EFI_HANDLE Controller,\r
- IN UINTN NumberOfChildren,\r
- IN EFI_HANDLE *ChildHandleBuffer\r
- );\r
\r
EFI_GUID gEfiUsbMouseAbsolutePointerDriverGuid = {\r
0xa579f729, 0xa71d, 0x4b45, { 0xbe, 0xd7, 0xd, 0xb0, 0xa8, 0x7c, 0x3e, 0x8d }\r
IN EFI_STATUS_CODE_VALUE Value\r
);\r
\r
+//\r
+// Prototypes\r
+// Driver model protocol interface\r
+//\r
+EFI_STATUS\r
+EFIAPI\r
+USBMouseAbsolutePointerDriverBindingEntryPoint (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
+ );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+USBMouseAbsolutePointerDriverBindingSupported (\r
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
+ IN EFI_HANDLE Controller,\r
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
+ );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+USBMouseAbsolutePointerDriverBindingStart (\r
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
+ IN EFI_HANDLE Controller,\r
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
+ );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+USBMouseAbsolutePointerDriverBindingStop (\r
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
+ IN EFI_HANDLE Controller,\r
+ IN UINTN NumberOfChildren,\r
+ IN EFI_HANDLE *ChildHandleBuffer\r
+ );\r
+\r
+\r
#endif\r
#include "UsbMouse.h"\r
#include "MouseHid.h"\r
\r
-/**\r
- The USB Mouse driver entry pointer.\r
-\r
- @param ImageHandle The driver image handle.\r
- @param SystemTable The system table.\r
-\r
- @return EFI_SUCCESS The component name protocol is installed.\r
- @return Others Failed to init the usb driver.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-USBMouseDriverBindingEntryPoint (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
- );\r
-\r
-/**\r
- Test to see if this driver supports ControllerHandle. Any ControllerHandle\r
- that has UsbIoProtocol installed will be supported.\r
-\r
- @param This Protocol instance pointer.\r
- @param Controller Handle of device to test.\r
- @param RemainingDevicePath Not used.\r
-\r
- @retval EFI_SUCCESS This driver supports this device.\r
- @retval EFI_UNSUPPORTED This driver does not support this device.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-USBMouseDriverBindingSupported (\r
- IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
- IN EFI_HANDLE Controller,\r
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
- );\r
-\r
-/**\r
- Starting the Usb Mouse Driver.\r
-\r
- @param This Protocol instance pointer.\r
- @param Controller Handle of device to test\r
- @param RemainingDevicePath Not used\r
-\r
- @retval EFI_SUCCESS This driver supports this device.\r
- @retval EFI_UNSUPPORTED This driver does not support this device.\r
- @retval EFI_DEVICE_ERROR This driver cannot be started due to device Error.\r
- @retval EFI_OUT_OF_RESOURCES Can't allocate memory resources.\r
- @retval EFI_ALREADY_STARTED Thios driver has been started.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-USBMouseDriverBindingStart (\r
- IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
- IN EFI_HANDLE Controller,\r
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
- );\r
-\r
-/**\r
- Stop this driver on ControllerHandle. Support stoping any child handles\r
- created by this driver.\r
-\r
- @param This Protocol instance pointer.\r
- @param Controller Handle of device to stop driver on.\r
- @param NumberOfChildren Number of Children in the ChildHandleBuffer.\r
- @param ChildHandleBuffer List of handles for the children we need to stop.\r
-\r
- @retval EFI_SUCCESS The controller or children are stopped.\r
- @retval Other Failed to stop the driver.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-USBMouseDriverBindingStop (\r
- IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
- IN EFI_HANDLE Controller,\r
- IN UINTN NumberOfChildren,\r
- IN EFI_HANDLE *ChildHandleBuffer\r
- );\r
\r
EFI_GUID gEfiUsbMouseDriverGuid = {\r
0x290156b5, 0x6a05, 0x4ac0, {0xb8, 0x0, 0x51, 0x27, 0x55, 0xad, 0x14, 0x29}\r
IN EFI_STATUS_CODE_VALUE Value\r
);\r
\r
+/**\r
+ The USB Mouse driver entry pointer.\r
+\r
+ @param ImageHandle The driver image handle.\r
+ @param SystemTable The system table.\r
+\r
+ @return EFI_SUCCESS The component name protocol is installed.\r
+ @return Others Failed to init the usb driver.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+USBMouseDriverBindingEntryPoint (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
+ );\r
+\r
+/**\r
+ Test to see if this driver supports ControllerHandle. Any ControllerHandle\r
+ that has UsbIoProtocol installed will be supported.\r
+\r
+ @param This Protocol instance pointer.\r
+ @param Controller Handle of device to test.\r
+ @param RemainingDevicePath Not used.\r
+\r
+ @retval EFI_SUCCESS This driver supports this device.\r
+ @retval EFI_UNSUPPORTED This driver does not support this device.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+USBMouseDriverBindingSupported (\r
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
+ IN EFI_HANDLE Controller,\r
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
+ );\r
+\r
+/**\r
+ Starting the Usb Mouse Driver.\r
+\r
+ @param This Protocol instance pointer.\r
+ @param Controller Handle of device to test\r
+ @param RemainingDevicePath Not used\r
+\r
+ @retval EFI_SUCCESS This driver supports this device.\r
+ @retval EFI_UNSUPPORTED This driver does not support this device.\r
+ @retval EFI_DEVICE_ERROR This driver cannot be started due to device Error.\r
+ @retval EFI_OUT_OF_RESOURCES Can't allocate memory resources.\r
+ @retval EFI_ALREADY_STARTED Thios driver has been started.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+USBMouseDriverBindingStart (\r
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
+ IN EFI_HANDLE Controller,\r
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
+ );\r
+\r
+/**\r
+ Stop this driver on ControllerHandle. Support stoping any child handles\r
+ created by this driver.\r
+\r
+ @param This Protocol instance pointer.\r
+ @param Controller Handle of device to stop driver on.\r
+ @param NumberOfChildren Number of Children in the ChildHandleBuffer.\r
+ @param ChildHandleBuffer List of handles for the children we need to stop.\r
+\r
+ @retval EFI_SUCCESS The controller or children are stopped.\r
+ @retval Other Failed to stop the driver.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+USBMouseDriverBindingStop (\r
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
+ IN EFI_HANDLE Controller,\r
+ IN UINTN NumberOfChildren,\r
+ IN EFI_HANDLE *ChildHandleBuffer\r
+ );\r
+\r
#endif\r
\r
#include "PeiMain.h"\r
\r
-/**\r
- The wrapper function of PeiLoadImageLoadImage().\r
-\r
- @param This - Pointer to EFI_PEI_LOAD_FILE_PPI.\r
- @param FileHandle - Pointer to the FFS file header of the image.\r
- @param ImageAddressArg - Pointer to PE/TE image.\r
- @param ImageSizeArg - Size of PE/TE image.\r
- @param EntryPoint - Pointer to entry point of specified image file for output.\r
- @param AuthenticationState - Pointer to attestation authentication state of image.\r
-\r
- @return Status of PeiLoadImageLoadImage().\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PeiLoadImageLoadImageWrapper (\r
- IN CONST EFI_PEI_LOAD_FILE_PPI *This,\r
- IN EFI_PEI_FILE_HANDLE FileHandle,\r
- OUT EFI_PHYSICAL_ADDRESS *ImageAddressArg, OPTIONAL\r
- OUT UINT64 *ImageSizeArg, OPTIONAL\r
- OUT EFI_PHYSICAL_ADDRESS *EntryPoint,\r
- OUT UINT32 *AuthenticationState\r
- );\r
\r
EFI_PEI_LOAD_FILE_PPI mPeiLoadImagePpi = {\r
PeiLoadImageLoadImageWrapper\r
@param PrivateData PeiCore's private data structure\r
@param OldCoreData Old data from SecCore\r
NULL if being run in non-permament memory mode.\r
- @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size \r
- and location of temporary RAM, the stack location and the BFV location.\r
+ @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size\r
+ and location of temporary RAM, the stack location and the BFV location.\r
\r
**/\r
VOID\r
OUT UINT32 *AuthenticationState\r
);\r
\r
+/**\r
+ The wrapper function of PeiLoadImageLoadImage().\r
+\r
+ @param This - Pointer to EFI_PEI_LOAD_FILE_PPI.\r
+ @param FileHandle - Pointer to the FFS file header of the image.\r
+ @param ImageAddressArg - Pointer to PE/TE image.\r
+ @param ImageSizeArg - Size of PE/TE image.\r
+ @param EntryPoint - Pointer to entry point of specified image file for output.\r
+ @param AuthenticationState - Pointer to attestation authentication state of image.\r
+\r
+ @return Status of PeiLoadImageLoadImage().\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PeiLoadImageLoadImageWrapper (\r
+ IN CONST EFI_PEI_LOAD_FILE_PPI *This,\r
+ IN EFI_PEI_FILE_HANDLE FileHandle,\r
+ OUT EFI_PHYSICAL_ADDRESS *ImageAddressArg, OPTIONAL\r
+ OUT UINT64 *ImageSizeArg, OPTIONAL\r
+ OUT EFI_PHYSICAL_ADDRESS *EntryPoint,\r
+ OUT UINT32 *AuthenticationState\r
+ );\r
+\r
+/**\r
+\r
+ Provide a callback for when the security PPI is installed.\r
+\r
+ @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
+ @param NotifyDescriptor The descriptor for the notification event.\r
+ @param Ppi Pointer to the PPI in question.\r
+\r
+ @return Always success\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+SecurityPpiNotifyCallback (\r
+ IN EFI_PEI_SERVICES **PeiServices,\r
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,\r
+ IN VOID *Ppi\r
+ );\r
+\r
#endif\r
\r
#include "PeiMain.h"\r
\r
-/**\r
-\r
- Provide a callback for when the security PPI is installed.\r
-\r
- @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
- @param NotifyDescriptor The descriptor for the notification event.\r
- @param Ppi Pointer to the PPI in question.\r
-\r
- @return Always success\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SecurityPpiNotifyCallback (\r
- IN EFI_PEI_SERVICES **PeiServices,\r
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,\r
- IN VOID *Ppi\r
- );\r
\r
EFI_PEI_NOTIFY_DESCRIPTOR mNotifyList = {\r
EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,\r
**/\r
\r
\r
-#include <PiDxe.h>\r
+#include "DxeCorePerformanceLibInternal.h"\r
\r
-#include <Protocol/Performance.h>\r
-#include <Guid/PeiPerformanceHob.h>\r
-\r
-#include <Library/PerformanceLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/HobLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/TimerLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-\r
-//\r
-// Interface declarations for Performance Protocol.\r
-//\r
-/**\r
- Adds a record at the end of the performance measurement log\r
- that records the start time of a performance measurement.\r
-\r
- Adds a record to the end of the performance measurement log\r
- that contains the Handle, Token, and Module.\r
- The end time of the new record must be set to zero.\r
- If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.\r
- If TimeStamp is zero, the start time in the record is filled in with the value\r
- read from the current time stamp.\r
-\r
- @param Handle Pointer to environment specific context used\r
- to identify the component being measured.\r
- @param Token Pointer to a Null-terminated ASCII string\r
- that identifies the component being measured.\r
- @param Module Pointer to a Null-terminated ASCII string\r
- that identifies the module being measured.\r
- @param TimeStamp 64-bit time stamp.\r
-\r
- @retval EFI_SUCCESS The data was read correctly from the device.\r
- @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-StartGauge (\r
- IN CONST VOID *Handle, OPTIONAL\r
- IN CONST CHAR8 *Token, OPTIONAL\r
- IN CONST CHAR8 *Module, OPTIONAL\r
- IN UINT64 TimeStamp\r
- );\r
-\r
-/**\r
- Searches the performance measurement log from the beginning of the log\r
- for the first matching record that contains a zero end time and fills in a valid end time.\r
-\r
- Searches the performance measurement log from the beginning of the log\r
- for the first record that matches Handle, Token, and Module and has an end time value of zero.\r
- If the record can not be found then return EFI_NOT_FOUND.\r
- If the record is found and TimeStamp is not zero,\r
- then the end time in the record is filled in with the value specified by TimeStamp.\r
- If the record is found and TimeStamp is zero, then the end time in the matching record\r
- is filled in with the current time stamp value.\r
-\r
- @param Handle Pointer to environment specific context used\r
- to identify the component being measured.\r
- @param Token Pointer to a Null-terminated ASCII string\r
- that identifies the component being measured.\r
- @param Module Pointer to a Null-terminated ASCII string\r
- that identifies the module being measured.\r
- @param TimeStamp 64-bit time stamp.\r
-\r
- @retval EFI_SUCCESS The end of the measurement was recorded.\r
- @retval EFI_NOT_FOUND The specified measurement record could not be found.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EndGauge (\r
- IN CONST VOID *Handle, OPTIONAL\r
- IN CONST CHAR8 *Token, OPTIONAL\r
- IN CONST CHAR8 *Module, OPTIONAL\r
- IN UINT64 TimeStamp\r
- );\r
-\r
-/**\r
- Retrieves a previously logged performance measurement.\r
-\r
- Retrieves the performance log entry from the performance log specified by LogEntryKey.\r
- If it stands for a valid entry, then EFI_SUCCESS is returned and\r
- GaugeDataEntry stores the pointer to that entry.\r
-\r
- @param LogEntryKey The key for the previous performance measurement log entry.\r
- If 0, then the first performance measurement log entry is retrieved.\r
- @param GaugeDataEntry The indirect pointer to the gauge data entry specified by LogEntryKey\r
- if the retrieval is successful.\r
-\r
- @retval EFI_SUCCESS The GuageDataEntry is successfuly found based on LogEntryKey.\r
- @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).\r
- @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).\r
- @retval EFI_INVALIDE_PARAMETER GaugeDataEntry is NULL.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-GetGauge (\r
- IN UINTN LogEntryKey,\r
- OUT GAUGE_DATA_ENTRY **GaugeDataEntry\r
- );\r
\r
//\r
// Definition for global variables.\r
GetGauge\r
};\r
\r
-\r
/**\r
Searches in the gauge array with keyword Handle, Token and Module.\r
\r
\r
[Sources.common]\r
DxeCorePerformanceLib.c\r
+ DxeCorePerformanceLibInternal.h\r
\r
[Packages]\r
MdePkg/MdePkg.dec\r
--- /dev/null
+/** @file\r
+ Module functions' declarations are included here.\r
+\r
+Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
+All rights reserved. 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
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+ \r
+#ifndef _DXE_CORE_PERFORMANCE_LIB_INTERNAL_H_\r
+#define _DXE_CORE_PERFORMANCE_LIB_INTERNAL_H_\r
+\r
+\r
+#include <PiDxe.h>\r
+\r
+#include <Protocol/Performance.h>\r
+#include <Guid/PeiPerformanceHob.h>\r
+\r
+#include <Library/PerformanceLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/HobLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/TimerLib.h>\r
+#include <Library/PcdLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+\r
+//\r
+// Interface declarations for Performance Protocol.\r
+//\r
+/**\r
+ Adds a record at the end of the performance measurement log\r
+ that records the start time of a performance measurement.\r
+\r
+ Adds a record to the end of the performance measurement log\r
+ that contains the Handle, Token, and Module.\r
+ The end time of the new record must be set to zero.\r
+ If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.\r
+ If TimeStamp is zero, the start time in the record is filled in with the value\r
+ read from the current time stamp.\r
+\r
+ @param Handle Pointer to environment specific context used\r
+ to identify the component being measured.\r
+ @param Token Pointer to a Null-terminated ASCII string\r
+ that identifies the component being measured.\r
+ @param Module Pointer to a Null-terminated ASCII string\r
+ that identifies the module being measured.\r
+ @param TimeStamp 64-bit time stamp.\r
+\r
+ @retval EFI_SUCCESS The data was read correctly from the device.\r
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+StartGauge (\r
+ IN CONST VOID *Handle, OPTIONAL\r
+ IN CONST CHAR8 *Token, OPTIONAL\r
+ IN CONST CHAR8 *Module, OPTIONAL\r
+ IN UINT64 TimeStamp\r
+ );\r
+\r
+/**\r
+ Searches the performance measurement log from the beginning of the log\r
+ for the first matching record that contains a zero end time and fills in a valid end time.\r
+\r
+ Searches the performance measurement log from the beginning of the log\r
+ for the first record that matches Handle, Token, and Module and has an end time value of zero.\r
+ If the record can not be found then return EFI_NOT_FOUND.\r
+ If the record is found and TimeStamp is not zero,\r
+ then the end time in the record is filled in with the value specified by TimeStamp.\r
+ If the record is found and TimeStamp is zero, then the end time in the matching record\r
+ is filled in with the current time stamp value.\r
+\r
+ @param Handle Pointer to environment specific context used\r
+ to identify the component being measured.\r
+ @param Token Pointer to a Null-terminated ASCII string\r
+ that identifies the component being measured.\r
+ @param Module Pointer to a Null-terminated ASCII string\r
+ that identifies the module being measured.\r
+ @param TimeStamp 64-bit time stamp.\r
+\r
+ @retval EFI_SUCCESS The end of the measurement was recorded.\r
+ @retval EFI_NOT_FOUND The specified measurement record could not be found.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EndGauge (\r
+ IN CONST VOID *Handle, OPTIONAL\r
+ IN CONST CHAR8 *Token, OPTIONAL\r
+ IN CONST CHAR8 *Module, OPTIONAL\r
+ IN UINT64 TimeStamp\r
+ );\r
+\r
+/**\r
+ Retrieves a previously logged performance measurement.\r
+\r
+ Retrieves the performance log entry from the performance log specified by LogEntryKey.\r
+ If it stands for a valid entry, then EFI_SUCCESS is returned and\r
+ GaugeDataEntry stores the pointer to that entry.\r
+\r
+ @param LogEntryKey The key for the previous performance measurement log entry.\r
+ If 0, then the first performance measurement log entry is retrieved.\r
+ @param GaugeDataEntry The indirect pointer to the gauge data entry specified by LogEntryKey\r
+ if the retrieval is successful.\r
+\r
+ @retval EFI_SUCCESS The GuageDataEntry is successfuly found based on LogEntryKey.\r
+ @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).\r
+ @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).\r
+ @retval EFI_INVALIDE_PARAMETER GaugeDataEntry is NULL.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetGauge (\r
+ IN UINTN LogEntryKey,\r
+ OUT GAUGE_DATA_ENTRY **GaugeDataEntry\r
+ );\r
+\r
+\r
+#endif\r
\r
EFI_HII_DATABASE_PROTOCOL *gIfrLibHiiDatabase;\r
EFI_HII_STRING_PROTOCOL *gIfrLibHiiString;\r
+GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_GUID mIfrVendorGuid = EFI_IFR_TIANO_GUID;\r
\r
/**\r
ExtendedIfrSupportLib's constructor. It locates the required protocol:\r
}\r
\r
\r
-\r
-GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_GUID mIfrVendorGuid = EFI_IFR_TIANO_GUID;\r
-\r
/**\r
Extract formset class for given HII handle.\r
\r
CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *mIfrSupportLibHiiConfigRouting = NULL;\r
GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 mIfrSupportLibHexStr[] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};\r
\r
+//\r
+// Fake <ConfigHdr>\r
+//\r
+GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT16 mFakeConfigHdr[] = L"GUID=00000000000000000000000000000000&NAME=0000&PATH=0";\r
+\r
/**\r
This function locate FormBrowser2 protocols for later usage.\r
\r
return EFI_SUCCESS;\r
}\r
\r
-//\r
-// Fake <ConfigHdr>\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT16 mFakeConfigHdr[] = L"GUID=00000000000000000000000000000000&NAME=0000&PATH=0";\r
-\r
/**\r
Draw a dialog and return the selected key.\r
\r
\r
#include "GraphicsConsole.h"\r
\r
-/**\r
- Gets Graphics Console devcie's foreground color and background color.\r
-\r
- @param This Protocol instance pointer.\r
- @param Foreground Returned text foreground color.\r
- @param Background Returned text background color.\r
-\r
- @retval EFI_SUCCESS It returned always.\r
-\r
-**/\r
-EFI_STATUS\r
-GetTextColors (\r
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
- OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Foreground,\r
- OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Background\r
- );\r
-\r
-/**\r
- Draw Unicode string on the Graphice Console device's screen.\r
-\r
- @param This Protocol instance pointer.\r
- @param UnicodeWeight One Unicode string to be displayed.\r
- @param Count The count of Unicode string.\r
-\r
- @retval EFI_OUT_OF_RESOURCES If no memory resource to use.\r
- @retval EFI_UNSUPPORTED If no Graphics Output protocol and UGA Draw\r
- protocol exist.\r
- @retval EFI_SUCCESS Drawing Unicode string implemented successfully.\r
-\r
-**/\r
-EFI_STATUS\r
-DrawUnicodeWeightAtCursorN (\r
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
- IN CHAR16 *UnicodeWeight,\r
- IN UINTN Count\r
- );\r
-\r
-/**\r
- Erase the cursor on the screen.\r
-\r
- @param This Protocol instance pointer.\r
-\r
- @retval EFI_SUCCESS The cursor is erased successfully.\r
-\r
-**/\r
-EFI_STATUS\r
-EraseCursor (\r
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This\r
- );\r
-\r
-/**\r
- Check if the current specific mode supported the user defined resolution\r
- for the Graphice Console devcie based on Graphics Output Protocol.\r
-\r
- If yes, set the graphic devcice's current mode to this specific mode.\r
- \r
- @param GraphicsOutput Graphics Output Protocol instance pointer.\r
- @param HorizontalResolution User defined horizontal resolution\r
- @param VerticalResolution User defined vertical resolution.\r
- @param CurrentModeNumber Current specific mode to be check.\r
-\r
- @retval EFI_SUCCESS The mode is supported.\r
- @retval EFI_UNSUPPORTED The specific mode is out of range of graphics \r
- devcie supported.\r
- @retval other The specific mode does not support user defined \r
- resolution or failed to set the current mode to the \r
- specific mode on graphics device.\r
-\r
-**/\r
-EFI_STATUS\r
-CheckModeSupported (\r
- EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,\r
- IN UINT32 HorizontalResolution,\r
- IN UINT32 VerticalResolution,\r
- OUT UINT32 *CurrentModeNumber\r
- );\r
\r
//\r
// Graphics Console Devcie Private Data template\r
NULL\r
};\r
\r
+/**\r
+ Gets Graphics Console devcie's foreground color and background color.\r
+\r
+ @param This Protocol instance pointer.\r
+ @param Foreground Returned text foreground color.\r
+ @param Background Returned text background color.\r
+\r
+ @retval EFI_SUCCESS It returned always.\r
+\r
+**/\r
+EFI_STATUS\r
+GetTextColors (\r
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
+ OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Foreground,\r
+ OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Background\r
+ );\r
+\r
+/**\r
+ Draw Unicode string on the Graphice Console device's screen.\r
+\r
+ @param This Protocol instance pointer.\r
+ @param UnicodeWeight One Unicode string to be displayed.\r
+ @param Count The count of Unicode string.\r
+\r
+ @retval EFI_OUT_OF_RESOURCES If no memory resource to use.\r
+ @retval EFI_UNSUPPORTED If no Graphics Output protocol and UGA Draw\r
+ protocol exist.\r
+ @retval EFI_SUCCESS Drawing Unicode string implemented successfully.\r
+\r
+**/\r
+EFI_STATUS\r
+DrawUnicodeWeightAtCursorN (\r
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r
+ IN CHAR16 *UnicodeWeight,\r
+ IN UINTN Count\r
+ );\r
+\r
+/**\r
+ Erase the cursor on the screen.\r
+\r
+ @param This Protocol instance pointer.\r
+\r
+ @retval EFI_SUCCESS The cursor is erased successfully.\r
+\r
+**/\r
+EFI_STATUS\r
+EraseCursor (\r
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This\r
+ );\r
+\r
+/**\r
+ Check if the current specific mode supported the user defined resolution\r
+ for the Graphice Console devcie based on Graphics Output Protocol.\r
+\r
+ If yes, set the graphic devcice's current mode to this specific mode.\r
+ \r
+ @param GraphicsOutput Graphics Output Protocol instance pointer.\r
+ @param HorizontalResolution User defined horizontal resolution\r
+ @param VerticalResolution User defined vertical resolution.\r
+ @param CurrentModeNumber Current specific mode to be check.\r
+\r
+ @retval EFI_SUCCESS The mode is supported.\r
+ @retval EFI_UNSUPPORTED The specific mode is out of range of graphics \r
+ devcie supported.\r
+ @retval other The specific mode does not support user defined \r
+ resolution or failed to set the current mode to the \r
+ specific mode on graphics device.\r
+\r
+**/\r
+EFI_STATUS\r
+CheckModeSupported (\r
+ EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,\r
+ IN UINT32 HorizontalResolution,\r
+ IN UINT32 VerticalResolution,\r
+ OUT UINT32 *CurrentModeNumber\r
+ );\r
+\r
\r
/**\r
Test to see if Graphics Console could be supported on the Controller.\r
\r
#include "Terminal.h"\r
\r
-/**\r
- Free notify functions list.\r
-\r
- @param ListHead The list head\r
-\r
- @retval EFI_SUCCESS Free the notify list successfully.\r
- @retval EFI_INVALID_PARAMETER ListHead is NULL.\r
-\r
-**/\r
-EFI_STATUS\r
-TerminalFreeNotifyList (\r
- IN OUT LIST_ENTRY *ListHead\r
- );\r
-\r
//\r
// Globals\r
//\r
};\r
\r
\r
+/**\r
+ Free notify functions list.\r
+\r
+ @param ListHead The list head\r
+\r
+ @retval EFI_SUCCESS Free the notify list successfully.\r
+ @retval EFI_INVALID_PARAMETER ListHead is NULL.\r
+\r
+**/\r
+EFI_STATUS\r
+TerminalFreeNotifyList (\r
+ IN OUT LIST_ENTRY *ListHead\r
+ );\r
+\r
/**\r
Test to see if this driver supports Controller. \r
\r
VOID (*RegisteredCallback) ();\r
} IVT_ENTRY;\r
\r
+IVT_ENTRY IvtEntryTable[NUM_IVT_ENTRIES];\r
+\r
+//\r
+// IPF context record is overallocated by 512 bytes to guarantee a 512 byte alignment exists\r
+// within the buffer and still have a large enough buffer to hold a whole IPF context record.\r
+//\r
+UINT8 IpfContextBuf[sizeof (EFI_SYSTEM_CONTEXT_IPF) + 512];\r
+\r
+//\r
+// The PatchSaveBuffer is used to store the original bundles from the IVT where it is patched\r
+// with the common handler.\r
+//\r
+UINT8 PatchSaveBuffer[0x400];\r
+UINTN ExternalInterruptCount;\r
+\r
/**\r
This is the worker function that uninstalls and removes all handlers.\r
\r
VOID **EntryPoint\r
);\r
\r
-IVT_ENTRY IvtEntryTable[NUM_IVT_ENTRIES];\r
-\r
-//\r
-// IPF context record is overallocated by 512 bytes to guarantee a 512 byte alignment exists\r
-// within the buffer and still have a large enough buffer to hold a whole IPF context record.\r
-//\r
-UINT8 IpfContextBuf[sizeof (EFI_SYSTEM_CONTEXT_IPF) + 512];\r
-\r
-//\r
-// The PatchSaveBuffer is used to store the original bundles from the IVT where it is patched\r
-// with the common handler.\r
-//\r
-UINT8 PatchSaveBuffer[0x400];\r
-UINTN ExternalInterruptCount;\r
\r
/**\r
IPF specific DebugSupport driver initialization. \r
\r
#include <IndustryStandard/Pci.h>\r
\r
-/**\r
- Convert EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS to PCI_LIB_ADDRESS.\r
-\r
- @param Address PCI address with\r
- EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS format.\r
-\r
- @return The PCI address with PCI_LIB_ADDRESS format.\r
-\r
-**/\r
-UINTN\r
-PciCfgAddressConvert (\r
- EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS *Address\r
- )\r
-{\r
- if (Address->ExtendedRegister == 0) {\r
- return PCI_LIB_ADDRESS (Address->Bus, Address->Device, Address->Function, Address->Register);\r
- }\r
-\r
- return PCI_LIB_ADDRESS (Address->Bus, Address->Device, Address->Function, Address->ExtendedRegister);\r
-}\r
-\r
/**\r
Reads from a given location in the PCI configuration space.\r
\r
&gPciCfg2Ppi\r
};\r
\r
+\r
+/**\r
+ Convert EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS to PCI_LIB_ADDRESS.\r
+\r
+ @param Address PCI address with\r
+ EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS format.\r
+\r
+ @return The PCI address with PCI_LIB_ADDRESS format.\r
+\r
+**/\r
+UINTN\r
+PciCfgAddressConvert (\r
+ EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS *Address\r
+ )\r
+{\r
+ if (Address->ExtendedRegister == 0) {\r
+ return PCI_LIB_ADDRESS (Address->Bus, Address->Device, Address->Function, Address->Register);\r
+ }\r
+\r
+ return PCI_LIB_ADDRESS (Address->Bus, Address->Device, Address->Function, Address->ExtendedRegister);\r
+}\r
+\r
+\r
/**\r
Reads from a given location in the PCI configuration space.\r
\r
};\r
\r
BOOLEAN mInputError;\r
+BOOLEAN GetLineByWidthFinished = FALSE;\r
\r
\r
/**\r
return Width;\r
}\r
\r
-\r
-BOOLEAN GetLineByWidthFinished = FALSE;\r
-\r
/**\r
Will copy LineWidth amount of a string in the OutputString buffer and return the\r
number of CHAR16 characters that were copied into the OutputString buffer.\r
EFI_EVENT mVirtualAddressChangeEvent = NULL;\r
EFI_HANDLE mHandle = NULL;\r
\r
+//\r
+// The current Hii implementation accesses this variable a larg # of times on every boot.\r
+// Other common variables are only accessed a single time. This is why this cache algorithm\r
+// only targets a single variable. Probably to get an performance improvement out of\r
+// a Cache you would need a cache that improves the search performance for a variable.\r
+//\r
+VARIABLE_CACHE_ENTRY mVariableCache[] = {\r
+ {\r
+ &gEfiGlobalVariableGuid,\r
+ L"Lang",\r
+ 0x00000000,\r
+ 0x00,\r
+ NULL\r
+ }\r
+};\r
+\r
+GLOBAL_REMOVE_IF_UNREFERENCED VARIABLE_INFO_ENTRY *gVariableInfo = NULL;\r
+\r
+\r
\r
//\r
// This is a temperary function which will be removed\r
}\r
\r
\r
-GLOBAL_REMOVE_IF_UNREFERENCED VARIABLE_INFO_ENTRY *gVariableInfo = NULL;\r
-\r
-\r
/**\r
Routine used to track statistical information about variable usage. \r
The data is stored in the EFI system table so it can be accessed later.\r
}\r
\r
\r
-//\r
-// The current Hii implementation accesses this variable a larg # of times on every boot.\r
-// Other common variables are only accessed a single time. This is why this cache algorithm\r
-// only targets a single variable. Probably to get an performance improvement out of\r
-// a Cache you would need a cache that improves the search performance for a variable.\r
-//\r
-VARIABLE_CACHE_ENTRY mVariableCache[] = {\r
- {\r
- &gEfiGlobalVariableGuid,\r
- L"Lang",\r
- 0x00000000,\r
- 0x00,\r
- NULL\r
- }\r
-};\r
-\r
-\r
/**\r
Update the Cache with Variable information. These are the same \r
arguments as the EFI Variable services.\r