]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update to support to produce Component Name and & Component Name 2 protocol based...
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 30 Sep 2007 02:42:47 +0000 (02:42 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 30 Sep 2007 02:42:47 +0000 (02:42 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4000 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Bus/Pci/AtapiPassThruDxe/AtapiPassThru.c
MdeModulePkg/Bus/Pci/AtapiPassThruDxe/AtapiPassThru.h
MdeModulePkg/Bus/Pci/AtapiPassThruDxe/ComponentName.c
MdeModulePkg/Bus/Pci/EhciDxe/ComponentName.c
MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
MdeModulePkg/Bus/Pci/EhciDxe/Ehci.h
MdeModulePkg/Bus/Pci/UhciDxe/ComponentName.c
MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
MdeModulePkg/Bus/Pci/UhciDxe/Uhci.h

index b6dceeb83a91d8890cf4ed5bf63cac2abb947402..fc0b8efbbc35ebbea872b7186ea89aa81847fbb6 100644 (file)
@@ -2393,14 +2393,13 @@ InitializeAtapiPassThru(
   //\r
   // Install driver model protocol(s).\r
   //\r
-  Status = EfiLibInstallAllDriverProtocols (\r
+  Status = EfiLibInstallDriverBindingComponentName2 (\r
              ImageHandle,\r
              SystemTable,\r
              &gAtapiScsiPassThruDriverBinding,\r
              ImageHandle,\r
              &gAtapiScsiPassThruComponentName,\r
-             NULL,\r
-             NULL\r
+             &gAtapiScsiPassThruComponentName2\r
              );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
index 0cb169786a284861cb5874b27284c52108b236ce..ac1db971d724e601b73ce785affc4f1c6320fdd3 100644 (file)
@@ -131,8 +131,9 @@ typedef struct {
 //\r
 // Global Variables\r
 //\r
-extern EFI_DRIVER_BINDING_PROTOCOL  gAtapiScsiPassThruDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL  gAtapiScsiPassThruComponentName;\r
+extern EFI_DRIVER_BINDING_PROTOCOL   gAtapiScsiPassThruDriverBinding;\r
+extern EFI_COMPONENT_NAME_PROTOCOL   gAtapiScsiPassThruComponentName;\r
+extern EFI_COMPONENT_NAME2_PROTOCOL  gAtapiScsiPassThruComponentName2;\r
 \r
 //\r
 // ATAPI Command op code\r
@@ -301,6 +302,45 @@ AtapiScsiPassThruDriverBindingStop (
 //\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
 AtapiScsiPassThruComponentNameGetDriverName (\r
@@ -309,6 +349,75 @@ AtapiScsiPassThruComponentNameGetDriverName (
   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
 AtapiScsiPassThruComponentNameGetControllerName (\r
@@ -319,6 +428,7 @@ AtapiScsiPassThruComponentNameGetControllerName (
   OUT CHAR16                                          **ControllerName\r
   );\r
 \r
+\r
 /**\r
   AtapiScsiPassThruDriverEntryPoint\r
 \r
index 1731571069b027f92b19c58bab856e0d8f0f5459..940b037bf2b7944981f7a52e54b6f8909d4be9cd 100644 (file)
 **/\r
 #include "AtapiPassThru.h"\r
 \r
-///\r
-/// EFI Component Name Protocol\r
-///\r
-EFI_COMPONENT_NAME_PROTOCOL     gAtapiScsiPassThruComponentName = {\r
+//\r
+// EFI Component Name Protocol\r
+//\r
+EFI_COMPONENT_NAME_PROTOCOL  gAtapiScsiPassThruComponentName = {\r
   AtapiScsiPassThruComponentNameGetDriverName,\r
   AtapiScsiPassThruComponentNameGetControllerName,\r
   "eng"\r
-};\r
+  };\r
+\r
+//\r
+// EFI Component Name 2 Protocol\r
+//\r
+EFI_COMPONENT_NAME2_PROTOCOL gAtapiScsiPassThruComponentName2 = {\r
+  (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) AtapiScsiPassThruComponentNameGetDriverName,\r
+  (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) AtapiScsiPassThruComponentNameGetControllerName,\r
+  "en"\r
+  };\r
+\r
 \r
 static EFI_UNICODE_STRING_TABLE mAtapiScsiPassThruDriverNameTable[] = {\r
-  { "eng", (CHAR16 *) L"ATAPI SCSI Pass Thru Driver" },\r
+  { "eng;en", (CHAR16 *) L"ATAPI SCSI Pass Thru Driver" },\r
   { NULL , NULL }\r
 };\r
 \r
 /**\r
-  Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
-\r
-  @param  This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
-  @param  Language A pointer to a three character ISO 639-2 language identifier.\r
-  This is the language of the driver name that that the caller\r
-  is requesting, and it must match one of the languages specified\r
-  in SupportedLanguages.  The number of languages supported by a\r
-  driver is up to the driver writer.\r
-  @param  DriverName A pointer to the Unicode string to return.  This Unicode string\r
-  is the name of the driver specified by This in the language\r
-  specified by Language.\r
-\r
-  @retval  EFI_SUCCESS The Unicode string for the Driver specified by This\r
-  and the language specified by Language was returned\r
-  in DriverName.\r
-  @retval  EFI_INVALID_PARAMETER Language is NULL.\r
-  @retval  EFI_INVALID_PARAMETER DriverName is NULL.\r
-  @retval  EFI_UNSUPPORTED The driver specified by This does not support the\r
-  language specified by Language.\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
@@ -57,53 +84,81 @@ AtapiScsiPassThruComponentNameGetDriverName (
   OUT CHAR16                       **DriverName\r
   )\r
 {\r
-  return LookupUnicodeString (\r
-          Language,\r
-          gAtapiScsiPassThruComponentName.SupportedLanguages,\r
-          mAtapiScsiPassThruDriverNameTable,\r
-          DriverName\r
-          );\r
+  return LookupUnicodeString2 (\r
+           Language,\r
+           This->SupportedLanguages,\r
+           mAtapiScsiPassThruDriverNameTable,\r
+           DriverName,\r
+           (BOOLEAN)(This == &gAtapiScsiPassThruComponentName)\r
+           );\r
 }\r
 \r
 /**\r
   Retrieves a Unicode string that is the user readable name of the controller\r
-  that is being managed by an EFI Driver.\r
-\r
-  @param  This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
-  @param  ControllerHandle The handle of a controller that the driver specified by\r
-  This is managing.  This handle specifies the controller\r
-  whose name is to be returned.\r
-  @param  ChildHandle The handle of the child controller to retrieve the name\r
-  of.  This is an optional parameter that may be NULL.  It\r
-  will be NULL for device drivers.  It will also be NULL\r
-  for a bus drivers that wish to retrieve the name of the\r
-  bus controller.  It will not be NULL for a bus driver\r
-  that wishes to retrieve the name of a child controller.\r
-  @param  Language A pointer to a three character ISO 639-2 language\r
-  identifier.  This is the language of the controller name\r
-  that that the caller is requesting, and it must match one\r
-  of the languages specified in SupportedLanguages.  The\r
-  number of languages supported by a driver is up to the\r
-  driver writer.\r
-  @param  ControllerName A pointer to the Unicode string to return.  This Unicode\r
-  string is the name of the controller specified by\r
-  ControllerHandle and ChildHandle in the language\r
-  specified by Language from the point of view of the\r
-  driver specified by This.\r
-\r
-  @retval  EFI_SUCCESS The Unicode string for the user readable name in the\r
-  language specified by Language for the driver\r
-  specified by This was returned in DriverName.\r
-  @retval  EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-  @retval  EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
-  EFI_HANDLE.\r
-  @retval  EFI_INVALID_PARAMETER Language is NULL.\r
-  @retval  EFI_INVALID_PARAMETER ControllerName is NULL.\r
-  @retval  EFI_UNSUPPORTED The driver specified by This is not currently\r
-  managing the controller specified by\r
-  ControllerHandle and ChildHandle.\r
-  @retval  EFI_UNSUPPORTED The driver specified by This does not support the\r
-  language specified by Language.\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
index 86029036f8f633679f31b0b2dee570fdcb24695a..8d533bbf91d8f88c3c32fb36af444640fa03a2be 100644 (file)
@@ -25,134 +25,290 @@ Abstract:
 //\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
+  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
+  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
-EFI_COMPONENT_NAME_PROTOCOL     gEhciComponentName = {\r
+EFI_COMPONENT_NAME_PROTOCOL  gEhciComponentName = {\r
   EhciComponentNameGetDriverName,\r
   EhciComponentNameGetControllerName,\r
   "eng"\r
-};\r
+  };\r
+\r
+//\r
+// EFI Component Name 2 Protocol\r
+//\r
+EFI_COMPONENT_NAME2_PROTOCOL gEhciComponentName2 = {\r
+  (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) EhciComponentNameGetDriverName,\r
+  (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) EhciComponentNameGetControllerName,\r
+  "en"\r
+  };\r
+\r
 \r
 static EFI_UNICODE_STRING_TABLE mEhciDriverNameTable[] = {\r
-  { "eng", L"Usb Ehci Driver" },\r
+  { "eng;en", L"Usb Ehci Driver" },\r
   { NULL , NULL }\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
+  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
+  IN  CHAR8                        *Language,\r
+  OUT CHAR16                       **DriverName\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
-\r
-  Arguments:\r
-    This       - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
-    Language   - A pointer to a three character ISO 639-2 language identifier.\r
-                 This is the language of the driver name that that the caller\r
-                 is requesting, and it must match one of the languages specified\r
-                 in SupportedLanguages.  The number of languages supported by a\r
-                 driver is up to the driver writer.\r
-    DriverName - A pointer to the Unicode string to return.  This Unicode string\r
-                 is the name of the driver specified by This in the language\r
-                 specified by Language.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The Unicode string for the Driver specified by This\r
-                            and the language specified by Language was returned\r
-                            in DriverName.\r
-    EFI_INVALID_PARAMETER - Language is NULL.\r
-    EFI_INVALID_PARAMETER - DriverName is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the\r
-                            language specified by Language.\r
-\r
---*/\r
 {\r
-  return LookupUnicodeString (\r
-          Language,\r
-          gEhciComponentName.SupportedLanguages,\r
-          mEhciDriverNameTable,\r
-          DriverName\r
-          );\r
+  return LookupUnicodeString2 (\r
+           Language,\r
+           This->SupportedLanguages,\r
+           mEhciDriverNameTable,\r
+           DriverName,\r
+           (BOOLEAN)(This == &gEhciComponentName)\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
+  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
-  Routine Description:\r
-    Retrieves a Unicode string that is the user readable name of the controller\r
-    that is being managed by an EFI Driver.\r
-\r
-  Arguments:\r
-    This             - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
-    ControllerHandle - The handle of a controller that the driver specified by\r
-                       This is managing.  This handle specifies the controller\r
-                       whose name is to be returned.\r
-    ChildHandle      - The handle of the child controller to retrieve the name\r
-                       of.  This is an optional parameter that may be NULL.  It\r
-                       will be NULL for device drivers.  It will also be NULL\r
-                       for a bus drivers that wish to retrieve the name of the\r
-                       bus controller.  It will not be NULL for a bus driver\r
-                       that wishes to retrieve the name of a child controller.\r
-    Language         - A pointer to a three character ISO 639-2 language\r
-                       identifier.  This is the language of the controller name\r
-                       that that the caller is requesting, and it must match one\r
-                       of the languages specified in SupportedLanguages.  The\r
-                       number of languages supported by a driver is up to the\r
-                       driver writer.\r
-    ControllerName   - A pointer to the Unicode string to return.  This Unicode\r
-                       string is the name of the controller specified by\r
-                       ControllerHandle and ChildHandle in the language\r
-                       specified by Language from the point of view of the\r
-                       driver specified by This.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The Unicode string for the user readable name in the\r
-                            language specified by Language for the driver\r
-                            specified by This was returned in DriverName.\r
-    EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid\r
-                            EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - Language is NULL.\r
-    EFI_INVALID_PARAMETER - ControllerName is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This is not currently\r
-                            managing the controller specified by\r
-                            ControllerHandle and ChildHandle.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the\r
-                            language specified by Language.\r
-\r
---*/\r
 {\r
   EFI_STATUS           Status;\r
   USB2_HC_DEV          *EhciDev;\r
@@ -192,11 +348,12 @@ EhciComponentNameGetControllerName (
 \r
   EhciDev = EHC_FROM_THIS (Usb2Hc);\r
 \r
-  return LookupUnicodeString (\r
-          Language,\r
-          gEhciComponentName.SupportedLanguages,\r
-          EhciDev->ControllerNameTable,\r
-          ControllerName\r
-          );\r
+  return LookupUnicodeString2 (\r
+           Language,\r
+           This->SupportedLanguages,\r
+           EhciDev->ControllerNameTable,\r
+           ControllerName,\r
+           (BOOLEAN)(This == &gEhciComponentName)\r
+           );\r
 \r
 }\r
index 0eaa9cce5dec3e0aa9b843f79a6d37002d72b043..13ce7fdfb1f9f9f58b4e57f107e46d12a8103642 100644 (file)
@@ -1295,14 +1295,13 @@ Returns:
 \r
 --*/\r
 {\r
-  return EfiLibInstallAllDriverProtocols (\r
+  return EfiLibInstallDriverBindingComponentName2 (\r
            ImageHandle,\r
            SystemTable,\r
            &gEhciDriverBinding,\r
            ImageHandle,\r
            &gEhciComponentName,\r
-           NULL,\r
-           NULL\r
+           &gEhciComponentName2\r
            );\r
 }\r
 \r
@@ -1565,13 +1564,22 @@ EhcDriverBindingStart (
   // Install the component name protocol, don't fail the start\r
   // because of something for display.\r
   //\r
-  AddUnicodeString (\r
+  AddUnicodeString2 (\r
     "eng",\r
     gEhciComponentName.SupportedLanguages,\r
     &Ehc->ControllerNameTable,\r
-    L"Enhanced Host Controller (USB 2.0)"\r
+    L"Enhanced Host Controller (USB 2.0)",\r
+    TRUE\r
+    );\r
+  AddUnicodeString2 (\r
+    "en",\r
+    gEhciComponentName2.SupportedLanguages,\r
+    &Ehc->ControllerNameTable,\r
+    L"Enhanced Host Controller (USB 2.0)",\r
+    FALSE\r
     );\r
 \r
+\r
   EHC_DEBUG (("EhcDriverBindingStart: EHCI started for controller @ %x\n", Controller));\r
   return EFI_SUCCESS;\r
 \r
index 2398b15667fb4b52e0fbfa4e9e53fd00b40477f7..7eb61be05afa443eab5f7336b45fe455008d5e83 100644 (file)
@@ -140,7 +140,8 @@ struct _USB2_HC_DEV {
 };\r
 \r
 \r
-extern EFI_DRIVER_BINDING_PROTOCOL     gEhciDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL     gEhciComponentName;\r
+extern EFI_DRIVER_BINDING_PROTOCOL      gEhciDriverBinding;\r
+extern EFI_COMPONENT_NAME_PROTOCOL      gEhciComponentName;\r
+extern EFI_COMPONENT_NAME2_PROTOCOL     gEhciComponentName2;\r
 \r
 #endif\r
index d1cb1eb1212342794efc2619e29a2480f342b740..bd2c3465f821ec0b9e1577e80f79f4a7069132a5 100644 (file)
@@ -23,134 +23,290 @@ Abstract:
 //\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
+  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
+  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
-EFI_COMPONENT_NAME_PROTOCOL     gUhciComponentName = {\r
+EFI_COMPONENT_NAME_PROTOCOL  gUhciComponentName = {\r
   UhciComponentNameGetDriverName,\r
   UhciComponentNameGetControllerName,\r
   "eng"\r
-};\r
+  };\r
+\r
+//\r
+// EFI Component Name 2 Protocol\r
+//\r
+EFI_COMPONENT_NAME2_PROTOCOL gUhciComponentName2 = {\r
+  (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) UhciComponentNameGetDriverName,\r
+  (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) UhciComponentNameGetControllerName,\r
+  "en"\r
+  };\r
+\r
 \r
 static EFI_UNICODE_STRING_TABLE mUhciDriverNameTable[] = {\r
-  { "eng", L"Usb Uhci Driver" },\r
+  { "eng;en", L"Usb Uhci Driver" },\r
   { NULL, NULL }\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
 UhciComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL     *This,\r
-  IN  CHAR8                           *Language,\r
-  OUT CHAR16                          **DriverName\r
+  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
+  IN  CHAR8                        *Language,\r
+  OUT CHAR16                       **DriverName\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
-\r
-  Arguments:\r
-    This       - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
-    Language   - A pointer to a three character ISO 639-2 language identifier.\r
-                 This is the language of the driver name that that the caller\r
-                 is requesting, and it must match one of the languages specified\r
-                 in SupportedLanguages.  The number of languages supported by a\r
-                 driver is up to the driver writer.\r
-    DriverName - A pointer to the Unicode string to return.  This Unicode string\r
-                 is the name of the driver specified by This in the language\r
-                 specified by Language.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The Unicode string for the Driver specified by This\r
-                            and the language specified by Language was returned\r
-                            in DriverName.\r
-    EFI_INVALID_PARAMETER - Language is NULL.\r
-    EFI_INVALID_PARAMETER - DriverName is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the\r
-                            language specified by Language.\r
-\r
---*/\r
 {\r
-  return LookupUnicodeString (\r
-          Language,\r
-          gUhciComponentName.SupportedLanguages,\r
-          mUhciDriverNameTable,\r
-          DriverName\r
-          );\r
+  return LookupUnicodeString2 (\r
+           Language,\r
+           This->SupportedLanguages,\r
+           mUhciDriverNameTable,\r
+           DriverName,\r
+           (BOOLEAN)(This == &gUhciComponentName)\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
+  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
-  Routine Description:\r
-    Retrieves a Unicode string that is the user readable name of the controller\r
-    that is being managed by an EFI Driver.\r
-\r
-  Arguments:\r
-    This             - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
-    ControllerHandle - The handle of a controller that the driver specified by\r
-                       This is managing.  This handle specifies the controller\r
-                       whose name is to be returned.\r
-    ChildHandle      - The handle of the child controller to retrieve the name\r
-                       of.  This is an optional parameter that may be NULL.  It\r
-                       will be NULL for device drivers.  It will also be NULL\r
-                       for a bus drivers that wish to retrieve the name of the\r
-                       bus controller.  It will not be NULL for a bus driver\r
-                       that wishes to retrieve the name of a child controller.\r
-    Language         - A pointer to a three character ISO 639-2 language\r
-                       identifier.  This is the language of the controller name\r
-                       that that the caller is requesting, and it must match one\r
-                       of the languages specified in SupportedLanguages.  The\r
-                       number of languages supported by a driver is up to the\r
-                       driver writer.\r
-    ControllerName   - A pointer to the Unicode string to return.  This Unicode\r
-                       string is the name of the controller specified by\r
-                       ControllerHandle and ChildHandle in the language\r
-                       specified by Language from the point of view of the\r
-                       driver specified by This.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The Unicode string for the user readable name in the\r
-                            language specified by Language for the driver\r
-                            specified by This was returned in DriverName.\r
-    EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid\r
-                            EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - Language is NULL.\r
-    EFI_INVALID_PARAMETER - ControllerName is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This is not currently\r
-                            managing the controller specified by\r
-                            ControllerHandle and ChildHandle.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the\r
-                            language specified by Language.\r
-\r
---*/\r
 {\r
   EFI_STATUS          Status;\r
   USB_HC_DEV          *UhciDev;\r
@@ -193,11 +349,12 @@ UhciComponentNameGetControllerName (
 \r
   UhciDev = UHC_FROM_USB_HC_PROTO (UsbHc);\r
 \r
-  return LookupUnicodeString (\r
-          Language,\r
-          gUhciComponentName.SupportedLanguages,\r
-          UhciDev->CtrlNameTable,\r
-          ControllerName\r
-          );\r
+  return LookupUnicodeString2 (\r
+           Language,\r
+           This->SupportedLanguages,\r
+           UhciDev->CtrlNameTable,\r
+           ControllerName,\r
+           (BOOLEAN)(This == &gUhciComponentName)\r
+           );\r
 \r
 }\r
index 28d9b63d9d242cfbedd2155c7da7f3d403d1334e..1dee9765041119288536ab6cf77026c02386bdea 100644 (file)
@@ -1852,14 +1852,13 @@ UhciDriverEntryPoint (
 \r
 --*/\r
 {\r
-  return EfiLibInstallAllDriverProtocols (\r
+  return EfiLibInstallDriverBindingComponentName2 (\r
            ImageHandle,\r
            SystemTable,\r
            &gUhciDriverBinding,\r
            ImageHandle,\r
            &gUhciComponentName,\r
-           NULL,\r
-           NULL\r
+           &gUhciComponentName2\r
            );\r
 }\r
 \r
@@ -2217,12 +2216,21 @@ UhciDriverBindingStart (
   //\r
   Uhc->CtrlNameTable = NULL;\r
 \r
-  AddUnicodeString (\r
+  AddUnicodeString2 (\r
     "eng",\r
     gUhciComponentName.SupportedLanguages,\r
     &Uhc->CtrlNameTable,\r
-    L"Usb Universal Host Controller"\r
+    L"Usb Universal Host Controller",\r
+    TRUE\r
     );\r
+  AddUnicodeString2 (\r
+    "en",\r
+    gUhciComponentName2.SupportedLanguages,\r
+    &Uhc->CtrlNameTable,\r
+    L"Usb Universal Host Controller",\r
+    FALSE\r
+    );\r
+\r
 \r
   //\r
   // Start the UHCI hardware, also set its reclamation point to 64 bytes\r
index 27d7497b879288c275a4a30e90bf6eb109c13d74..3f2540faf7d1522c6f166eb19b50c609592f7dbe 100644 (file)
@@ -128,7 +128,8 @@ struct _USB_HC_DEV {
   VOID                      *FrameMapping;\r
 };\r
 \r
-extern EFI_DRIVER_BINDING_PROTOCOL  gUhciDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL  gUhciComponentName;\r
+extern EFI_DRIVER_BINDING_PROTOCOL   gUhciDriverBinding;\r
+extern EFI_COMPONENT_NAME_PROTOCOL   gUhciComponentName;\r
+extern EFI_COMPONENT_NAME2_PROTOCOL  gUhciComponentName2;\r
 \r
 #endif\r