]> 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 03:01:48 +0000 (03:01 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 30 Sep 2007 03:01:48 +0000 (03:01 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4003 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Disk/DiskIoDxe/ComponentName.c
MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.h
MdeModulePkg/Universal/Disk/PartitionDxe/ComponentName.c
MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h

index bf95be158c9c5c52d88c7d6bfc7d745fecaf344e..96fee5cb5ff0c1a7b6c6a6654dca0ba002928450 100644 (file)
 //\r
 // EFI Component Name Protocol\r
 //\r
 //\r
 // EFI Component Name Protocol\r
 //\r
-EFI_COMPONENT_NAME_PROTOCOL     gDiskIoComponentName = {\r
+EFI_COMPONENT_NAME_PROTOCOL  gDiskIoComponentName = {\r
   DiskIoComponentNameGetDriverName,\r
   DiskIoComponentNameGetControllerName,\r
   "eng"\r
   DiskIoComponentNameGetDriverName,\r
   DiskIoComponentNameGetControllerName,\r
   "eng"\r
-};\r
+  };\r
+\r
+//\r
+// EFI Component Name 2 Protocol\r
+//\r
+EFI_COMPONENT_NAME2_PROTOCOL gDiskIoComponentName2 = {\r
+  (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) DiskIoComponentNameGetDriverName,\r
+  (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) DiskIoComponentNameGetControllerName,\r
+  "en"\r
+  };\r
+\r
 \r
 static EFI_UNICODE_STRING_TABLE mDiskIoDriverNameTable[] = {\r
   {\r
 \r
 static EFI_UNICODE_STRING_TABLE mDiskIoDriverNameTable[] = {\r
   {\r
-    "eng",\r
+    "eng;en",\r
     (CHAR16 *)L"Generic Disk I/O Driver"\r
   },\r
   {\r
     (CHAR16 *)L"Generic Disk I/O Driver"\r
   },\r
   {\r
@@ -37,39 +47,42 @@ static EFI_UNICODE_STRING_TABLE mDiskIoDriverNameTable[] = {
 \r
 \r
 /**\r
 \r
 \r
 /**\r
-  Retrieves a Unicode string that is the user readable name of\r
-  the EFI Driver.\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
 \r
-  @param  This       A pointer to the\r
-                     EFI_COMPONENT_NAME_PROTOCOL instance.\r
-  \r
-  @param  Language   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\r
-                     is requesting, and it must match one of the\r
-                     languages specified in SupportedLanguages.\r
-                     The number of languages supported by a\r
-                     driver is up to the driver writer. Language\r
-                     is specified in RFC 3066 language code\r
-                     format.\r
-  \r
-  @param  DriverName 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\r
-                                Driver specified by This and the\r
-                                language specified by Language\r
-                                was returned in DriverName.\r
-  \r
   @retval EFI_INVALID_PARAMETER Language is NULL.\r
   @retval EFI_INVALID_PARAMETER Language is NULL.\r
-  \r
+\r
   @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
   @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-  \r
-  @retval EFI_UNSUPPORTED       The driver specified by This\r
-                                does not support the language\r
-                                specified by Language.\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
 \r
 **/\r
 EFI_STATUS\r
@@ -80,84 +93,83 @@ DiskIoComponentNameGetDriverName (
   OUT CHAR16                       **DriverName\r
   )\r
 {\r
   OUT CHAR16                       **DriverName\r
   )\r
 {\r
-  return LookupUnicodeString (\r
+  return LookupUnicodeString2 (\r
            Language,\r
            Language,\r
-           gDiskIoComponentName.SupportedLanguages,\r
+           This->SupportedLanguages,\r
            mDiskIoDriverNameTable,\r
            mDiskIoDriverNameTable,\r
-           DriverName\r
+           DriverName,\r
+           (BOOLEAN)(This == &gDiskIoComponentName)\r
            );\r
 }\r
 \r
 \r
 \r
 /**\r
            );\r
 }\r
 \r
 \r
 \r
 /**\r
-  Retrieves a Unicode string that is the user readable name of\r
-  the controller that is being managed by an EFI Driver.\r
-\r
-  @param  This             A pointer to the\r
-                           EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  ControllerHandle The handle of a controller that the\r
-                           driver specified by This is managing.\r
-                           This handle specifies the controller\r
-                           whose name is to be returned.\r
-\r
-  @param ChildHandle      The handle of the child controller to\r
-                           retrieve the name of.  This is an\r
-                           optional parameter that may be NULL.\r
-                           It will be NULL for device drivers.\r
-                           It will also be NULL for a bus\r
-                           drivers that wish to retrieve the\r
-                           name of the bus controller.  It will\r
-                           not be NULL for a bus driver that\r
-                           wishes to retrieve the name of a\r
-                           child controller.\r
-\r
-  @param  Language         A pointer to a Null-terminated ASCII\r
-                           string array indicating the language.\r
-                           This is the language of the driver\r
-                           name that the caller is requesting,\r
-                           and it must match one of the\r
-                           languages specified in\r
-                           SupportedLanguages. The number of\r
-                           languages supported by a driver is up\r
-                           to the driver writer. Language is\r
-                           specified in RFC 3066 language code\r
-                           format.\r
-\r
-  @param  ControllerName   A pointer to the Unicode string to\r
-                           return.  This Unicode string is the\r
-                           name of the controller specified by\r
-                           ControllerHandle and ChildHandle in\r
-                           the language specified by Language\r
-                           from the point of view of the driver\r
-                           specified by This.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the user\r
-                                readable name in the language\r
-                                specified by Language for the\r
-                                driver specified by This was\r
-                                returned in DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid\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
                                 EFI_HANDLE.\r
 \r
-  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it\r
-                                is not a valid EFI_HANDLE.\r
-\r
   @retval EFI_INVALID_PARAMETER Language is NULL.\r
 \r
   @retval EFI_INVALID_PARAMETER ControllerName is NULL.\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\r
-                                not currently managing the\r
-                                controller specified by\r
-                                ControllerHandle and\r
-                                ChildHandle.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
+                                managing the controller specified by\r
+                                ControllerHandle and ChildHandle.\r
 \r
 \r
-  @retval EFI_UNSUPPORTED       The driver specified by This\r
-                                does not support the language\r
-                                specified by Language.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
+                                the language specified by Language.\r
 \r
 **/\r
 EFI_STATUS\r
 \r
 **/\r
 EFI_STATUS\r
index 0cb49224ca7ad80c13ad43cc0340482a05378976..8f50ec859df5227befd773b5af843e7d680f4c4c 100644 (file)
@@ -720,14 +720,13 @@ InitializeDiskIo (
   //\r
   // Install driver model protocol(s).\r
   //\r
   //\r
   // Install driver model protocol(s).\r
   //\r
-  Status = EfiLibInstallAllDriverProtocols (\r
+  Status = EfiLibInstallDriverBindingComponentName2 (\r
              ImageHandle,\r
              SystemTable,\r
              &gDiskIoDriverBinding,\r
              ImageHandle,\r
              &gDiskIoComponentName,\r
              ImageHandle,\r
              SystemTable,\r
              &gDiskIoDriverBinding,\r
              ImageHandle,\r
              &gDiskIoComponentName,\r
-             NULL,\r
-             NULL\r
+             &gDiskIoComponentName2\r
              );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
              );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
index c1a572f846bafcd5c5ae0e6bbf68d6a5e948eb78..f4fa28a4200aa569529bff2d0c818e908d914ed9 100644 (file)
@@ -45,8 +45,9 @@ typedef struct {
 //\r
 // Global Variables\r
 //\r
 //\r
 // Global Variables\r
 //\r
-extern EFI_DRIVER_BINDING_PROTOCOL  gDiskIoDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL  gDiskIoComponentName;\r
+extern EFI_DRIVER_BINDING_PROTOCOL   gDiskIoDriverBinding;\r
+extern EFI_COMPONENT_NAME_PROTOCOL   gDiskIoComponentName;\r
+extern EFI_COMPONENT_NAME2_PROTOCOL  gDiskIoComponentName2;\r
 \r
 //\r
 // Prototypes\r
 \r
 //\r
 // Prototypes\r
@@ -103,6 +104,45 @@ DiskIoWriteDisk (
 //\r
 // EFI Component Name Functions\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
 DiskIoComponentNameGetDriverName (\r
 EFI_STATUS\r
 EFIAPI\r
 DiskIoComponentNameGetDriverName (\r
@@ -111,6 +151,75 @@ DiskIoComponentNameGetDriverName (
   OUT CHAR16                       **DriverName\r
   );\r
 \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
 DiskIoComponentNameGetControllerName (\r
 EFI_STATUS\r
 EFIAPI\r
 DiskIoComponentNameGetControllerName (\r
@@ -121,4 +230,5 @@ DiskIoComponentNameGetControllerName (
   OUT CHAR16                                          **ControllerName\r
   );\r
 \r
   OUT CHAR16                                          **ControllerName\r
   );\r
 \r
+\r
 #endif\r
 #endif\r
index e922cb0f9285e8813fc1517d587280665ec5b7f7..6daf8d8abb740d93764d299f27914af62157cd43 100644 (file)
 //\r
 // EFI Component Name Protocol\r
 //\r
 //\r
 // EFI Component Name Protocol\r
 //\r
-EFI_COMPONENT_NAME_PROTOCOL     gPartitionComponentName = {\r
+EFI_COMPONENT_NAME_PROTOCOL  gPartitionComponentName = {\r
   PartitionComponentNameGetDriverName,\r
   PartitionComponentNameGetControllerName,\r
   "eng"\r
   PartitionComponentNameGetDriverName,\r
   PartitionComponentNameGetControllerName,\r
   "eng"\r
-};\r
+  };\r
+\r
+//\r
+// EFI Component Name 2 Protocol\r
+//\r
+EFI_COMPONENT_NAME2_PROTOCOL gPartitionComponentName2 = {\r
+  (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) PartitionComponentNameGetDriverName,\r
+  (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) PartitionComponentNameGetControllerName,\r
+  "en"\r
+  };\r
+\r
 \r
 static EFI_UNICODE_STRING_TABLE mPartitionDriverNameTable[] = {\r
   {\r
 \r
 static EFI_UNICODE_STRING_TABLE mPartitionDriverNameTable[] = {\r
   {\r
-    "eng",\r
+    "eng;en",\r
     (CHAR16 *)L"Partition Driver(MBR/GPT/El Torito)"\r
   },\r
   {\r
     (CHAR16 *)L"Partition Driver(MBR/GPT/El Torito)"\r
   },\r
   {\r
@@ -37,39 +47,42 @@ static EFI_UNICODE_STRING_TABLE mPartitionDriverNameTable[] = {
 \r
 \r
 /**\r
 \r
 \r
 /**\r
-  Retrieves a Unicode string that is the user readable name of\r
-  the EFI Driver.\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
 \r
-  @param  This       A pointer to the\r
-                     EFI_COMPONENT_NAME_PROTOCOL instance.\r
-  \r
-  @param  Language   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\r
-                     is requesting, and it must match one of the\r
-                     languages specified in SupportedLanguages.\r
-                     The number of languages supported by a\r
-                     driver is up to the driver writer. Language\r
-                     is specified in RFC 3066 language code\r
-                     format.\r
-  \r
-  @param  DriverName 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\r
-                                Driver specified by This and the\r
-                                language specified by Language\r
-                                was returned in DriverName.\r
-  \r
   @retval EFI_INVALID_PARAMETER Language is NULL.\r
   @retval EFI_INVALID_PARAMETER Language is NULL.\r
-  \r
+\r
   @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
   @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-  \r
-  @retval EFI_UNSUPPORTED       The driver specified by This\r
-                                does not support the language\r
-                                specified by Language.\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
 \r
 **/\r
 EFI_STATUS\r
@@ -80,83 +93,82 @@ PartitionComponentNameGetDriverName (
   OUT CHAR16                       **DriverName\r
   )\r
 {\r
   OUT CHAR16                       **DriverName\r
   )\r
 {\r
-  return LookupUnicodeString (\r
-          Language,\r
-          gPartitionComponentName.SupportedLanguages,\r
-          mPartitionDriverNameTable,\r
-          DriverName\r
-          );\r
+  return LookupUnicodeString2 (\r
+           Language,\r
+           This->SupportedLanguages,\r
+           mPartitionDriverNameTable,\r
+           DriverName,\r
+           (BOOLEAN)(This == &gPartitionComponentName)\r
+           );\r
 }\r
 \r
 \r
 /**\r
 }\r
 \r
 \r
 /**\r
-  Retrieves a Unicode string that is the user readable name of\r
-  the controller that is being managed by an EFI Driver.\r
-\r
-  @param  This             A pointer to the\r
-                           EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  ControllerHandle The handle of a controller that the\r
-                           driver specified by This is managing.\r
-                           This handle specifies the controller\r
-                           whose name is to be returned.\r
-\r
-  @param ChildHandle      The handle of the child controller to\r
-                           retrieve the name of.  This is an\r
-                           optional parameter that may be NULL.\r
-                           It will be NULL for device drivers.\r
-                           It will also be NULL for a bus\r
-                           drivers that wish to retrieve the\r
-                           name of the bus controller.  It will\r
-                           not be NULL for a bus driver that\r
-                           wishes to retrieve the name of a\r
-                           child controller.\r
-\r
-  @param  Language         A pointer to a Null-terminated ASCII\r
-                           string array indicating the language.\r
-                           This is the language of the driver\r
-                           name that the caller is requesting,\r
-                           and it must match one of the\r
-                           languages specified in\r
-                           SupportedLanguages. The number of\r
-                           languages supported by a driver is up\r
-                           to the driver writer. Language is\r
-                           specified in RFC 3066 language code\r
-                           format.\r
-\r
-  @param  ControllerName   A pointer to the Unicode string to\r
-                           return.  This Unicode string is the\r
-                           name of the controller specified by\r
-                           ControllerHandle and ChildHandle in\r
-                           the language specified by Language\r
-                           from the point of view of the driver\r
-                           specified by This.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the user\r
-                                readable name in the language\r
-                                specified by Language for the\r
-                                driver specified by This was\r
-                                returned in DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid\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
                                 EFI_HANDLE.\r
 \r
-  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it\r
-                                is not a valid EFI_HANDLE.\r
-\r
   @retval EFI_INVALID_PARAMETER Language is NULL.\r
 \r
   @retval EFI_INVALID_PARAMETER ControllerName is NULL.\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\r
-                                not currently managing the\r
-                                controller specified by\r
-                                ControllerHandle and\r
-                                ChildHandle.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
+                                managing the controller specified by\r
+                                ControllerHandle and ChildHandle.\r
 \r
 \r
-  @retval EFI_UNSUPPORTED       The driver specified by This\r
-                                does not support the language\r
-                                specified by Language.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
+                                the language specified by Language.\r
 \r
 **/\r
 EFI_STATUS\r
 \r
 **/\r
 EFI_STATUS\r
index 4d0c76f251960d54d5a908290813e4c054064e87..b68c1db3e66cd0ffd3230c0cc214e7f562d3a5f5 100644 (file)
@@ -695,14 +695,13 @@ InitializePartition (
   //\r
   // Install driver model protocol(s).\r
   //\r
   //\r
   // Install driver model protocol(s).\r
   //\r
-  Status = EfiLibInstallAllDriverProtocols (\r
+  Status = EfiLibInstallDriverBindingComponentName2 (\r
              ImageHandle,\r
              SystemTable,\r
              &gPartitionDriverBinding,\r
              ImageHandle,\r
              &gPartitionComponentName,\r
              ImageHandle,\r
              SystemTable,\r
              &gPartitionDriverBinding,\r
              ImageHandle,\r
              &gPartitionComponentName,\r
-             NULL,\r
-             NULL\r
+             &gPartitionComponentName2\r
              );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
              );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
index 570d0194b5114d9b8bb722cd40ceaade34d62435..854020c104697a1c9acbca1a7a61835a7e3dee53 100644 (file)
@@ -65,8 +65,9 @@ typedef struct {
 //\r
 // Global Variables\r
 //\r
 //\r
 // Global Variables\r
 //\r
-extern EFI_DRIVER_BINDING_PROTOCOL  gPartitionDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL  gPartitionComponentName;\r
+extern EFI_DRIVER_BINDING_PROTOCOL   gPartitionDriverBinding;\r
+extern EFI_COMPONENT_NAME_PROTOCOL   gPartitionComponentName;\r
+extern EFI_COMPONENT_NAME2_PROTOCOL  gPartitionComponentName2;\r
 \r
 //\r
 // Extract INT32 from char array\r
 \r
 //\r
 // Extract INT32 from char array\r
@@ -115,6 +116,45 @@ PartitionDriverBindingStop (
 //\r
 // EFI Component Name Functions\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
 PartitionComponentNameGetDriverName (\r
 EFI_STATUS\r
 EFIAPI\r
 PartitionComponentNameGetDriverName (\r
@@ -123,6 +163,75 @@ PartitionComponentNameGetDriverName (
   OUT CHAR16                       **DriverName\r
   );\r
 \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
 PartitionComponentNameGetControllerName (\r
 EFI_STATUS\r
 EFIAPI\r
 PartitionComponentNameGetControllerName (\r
@@ -133,6 +242,7 @@ PartitionComponentNameGetControllerName (
   OUT CHAR16                                          **ControllerName\r
   );\r
 \r
   OUT CHAR16                                          **ControllerName\r
   );\r
 \r
+\r
 EFI_STATUS\r
 PartitionInstallChildHandle (\r
   IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
 EFI_STATUS\r
 PartitionInstallChildHandle (\r
   IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r