Update to support to produce Component Name and & Component Name 2 protocol based on Feature flag PcdComponentNameDisable & PcdComponentName2Disable.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3996 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
		| @@ -22,9 +22,19 @@ EFI_COMPONENT_NAME_PROTOCOL     gIsaBusComponentName = { | ||||
|   "eng" | ||||
|   }; | ||||
|  | ||||
| // | ||||
| // EFI Component Name 2 Protocol | ||||
| // | ||||
| EFI_COMPONENT_NAME2_PROTOCOL gIsaBusComponentName2 = { | ||||
|   (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) IsaBusComponentNameGetDriverName, | ||||
|   (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) IsaBusComponentNameGetControllerName, | ||||
|   "en" | ||||
|   }; | ||||
|  | ||||
|  | ||||
| STATIC EFI_UNICODE_STRING_TABLE mIsaBusDriverNameTable[] = { | ||||
|   { | ||||
|     "eng", | ||||
|     "eng;en", | ||||
|     L"ISA Bus Driver" | ||||
|   }, | ||||
|   { | ||||
| @@ -33,6 +43,45 @@ STATIC EFI_UNICODE_STRING_TABLE mIsaBusDriverNameTable[] = { | ||||
|   } | ||||
| }; | ||||
|  | ||||
| /** | ||||
|   Retrieves a Unicode string that is the user readable name of the driver. | ||||
|  | ||||
|   This function retrieves the user readable name of a driver in the form of a | ||||
|   Unicode string. If the driver specified by This has a user readable name in | ||||
|   the language specified by Language, then a pointer to the driver name is | ||||
|   returned in DriverName, and EFI_SUCCESS is returned. If the driver specified | ||||
|   by This does not support the language specified by Language, | ||||
|   then EFI_UNSUPPORTED is returned. | ||||
|  | ||||
|   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | ||||
|                                 EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|  | ||||
|   @param  Language[in]          A pointer to a Null-terminated ASCII string | ||||
|                                 array indicating the language. This is the | ||||
|                                 language of the driver name that the caller is | ||||
|                                 requesting, and it must match one of the | ||||
|                                 languages specified in SupportedLanguages. The | ||||
|                                 number of languages supported by a driver is up | ||||
|                                 to the driver writer. Language is specified | ||||
|                                 in RFC 3066 or ISO 639-2 language code format. | ||||
|  | ||||
|   @param  DriverName[out]       A pointer to the Unicode string to return. | ||||
|                                 This Unicode string is the name of the | ||||
|                                 driver specified by This in the language | ||||
|                                 specified by Language. | ||||
|  | ||||
|   @retval EFI_SUCCESS           The Unicode string for the Driver specified by | ||||
|                                 This and the language specified by Language was | ||||
|                                 returned in DriverName. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER Language is NULL. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER DriverName is NULL. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This does not support | ||||
|                                 the language specified by Language. | ||||
|  | ||||
| **/ | ||||
| EFI_STATUS | ||||
| EFIAPI | ||||
| IsaBusComponentNameGetDriverName ( | ||||
| @@ -40,41 +89,84 @@ IsaBusComponentNameGetDriverName ( | ||||
|   IN  CHAR8                        *Language, | ||||
|   OUT CHAR16                       **DriverName | ||||
|   ) | ||||
| /*++ | ||||
|  | ||||
|   Routine Description: | ||||
|     Retrieves a Unicode string that is the user readable name of the EFI Driver. | ||||
|  | ||||
|   Arguments: | ||||
|     This       - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|     Language   - A pointer to a three character ISO 639-2 language identifier. | ||||
|                  This is the language of the driver name that that the caller  | ||||
|                  is requesting, and it must match one of the languages specified | ||||
|                  in SupportedLanguages.  The number of languages supported by a  | ||||
|                  driver is up to the driver writer. | ||||
|     DriverName - A pointer to the Unicode string to return.  This Unicode string | ||||
|                  is the name of the driver specified by This in the language  | ||||
|                  specified by Language. | ||||
|  | ||||
|   Returns: | ||||
|     EFI_SUCCESS           - The Unicode string for the Driver specified by This | ||||
|                             and the language specified by Language was returned  | ||||
|                             in DriverName. | ||||
|     EFI_INVALID_PARAMETER - Language is NULL. | ||||
|     EFI_INVALID_PARAMETER - DriverName is NULL. | ||||
|     EFI_UNSUPPORTED       - The driver specified by This does not support the  | ||||
|                             language specified by Language. | ||||
|  | ||||
| --*/ | ||||
| { | ||||
|   return LookupUnicodeString ( | ||||
|   return LookupUnicodeString2 ( | ||||
|            Language, | ||||
|           gIsaBusComponentName.SupportedLanguages, | ||||
|            This->SupportedLanguages, | ||||
|            mIsaBusDriverNameTable, | ||||
|           DriverName | ||||
|            DriverName, | ||||
|            (BOOLEAN)(This == &gIsaBusComponentName) | ||||
|            ); | ||||
| } | ||||
|  | ||||
| /** | ||||
|   Retrieves a Unicode string that is the user readable name of the controller | ||||
|   that is being managed by a driver. | ||||
|  | ||||
|   This function retrieves the user readable name of the controller specified by | ||||
|   ControllerHandle and ChildHandle in the form of a Unicode string. If the | ||||
|   driver specified by This has a user readable name in the language specified by | ||||
|   Language, then a pointer to the controller name is returned in ControllerName, | ||||
|   and EFI_SUCCESS is returned.  If the driver specified by This is not currently | ||||
|   managing the controller specified by ControllerHandle and ChildHandle, | ||||
|   then EFI_UNSUPPORTED is returned.  If the driver specified by This does not | ||||
|   support the language specified by Language, then EFI_UNSUPPORTED is returned. | ||||
|  | ||||
|   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | ||||
|                                 EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|  | ||||
|   @param  ControllerHandle[in]  The handle of a controller that the driver | ||||
|                                 specified by This is managing.  This handle | ||||
|                                 specifies the controller whose name is to be | ||||
|                                 returned. | ||||
|  | ||||
|   @param  ChildHandle[in]       The handle of the child controller to retrieve | ||||
|                                 the name of.  This is an optional parameter that | ||||
|                                 may be NULL.  It will be NULL for device | ||||
|                                 drivers.  It will also be NULL for a bus drivers | ||||
|                                 that wish to retrieve the name of the bus | ||||
|                                 controller.  It will not be NULL for a bus | ||||
|                                 driver that wishes to retrieve the name of a | ||||
|                                 child controller. | ||||
|  | ||||
|   @param  Language[in]          A pointer to a Null-terminated ASCII string | ||||
|                                 array indicating the language.  This is the | ||||
|                                 language of the driver name that the caller is | ||||
|                                 requesting, and it must match one of the | ||||
|                                 languages specified in SupportedLanguages. The | ||||
|                                 number of languages supported by a driver is up | ||||
|                                 to the driver writer. Language is specified in | ||||
|                                 RFC 3066 or ISO 639-2 language code format. | ||||
|  | ||||
|   @param  ControllerName[out]   A pointer to the Unicode string to return. | ||||
|                                 This Unicode string is the name of the | ||||
|                                 controller specified by ControllerHandle and | ||||
|                                 ChildHandle in the language specified by | ||||
|                                 Language from the point of view of the driver | ||||
|                                 specified by This. | ||||
|  | ||||
|   @retval EFI_SUCCESS           The Unicode string for the user readable name in | ||||
|                                 the language specified by Language for the | ||||
|                                 driver specified by This was returned in | ||||
|                                 DriverName. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid | ||||
|                                 EFI_HANDLE. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER Language is NULL. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ControllerName is NULL. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This is not currently | ||||
|                                 managing the controller specified by | ||||
|                                 ControllerHandle and ChildHandle. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This does not support | ||||
|                                 the language specified by Language. | ||||
|  | ||||
| **/ | ||||
| EFI_STATUS | ||||
| EFIAPI | ||||
| IsaBusComponentNameGetControllerName ( | ||||
| @@ -84,51 +176,6 @@ IsaBusComponentNameGetControllerName ( | ||||
|   IN  CHAR8                                           *Language, | ||||
|   OUT CHAR16                                          **ControllerName | ||||
|   ) | ||||
| /*++ | ||||
|  | ||||
|   Routine Description: | ||||
|     Retrieves a Unicode string that is the user readable name of the controller | ||||
|     that is being managed by an EFI Driver. | ||||
|  | ||||
|   Arguments: | ||||
|     This             - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|     ControllerHandle - The handle of a controller that the driver specified by  | ||||
|                        This is managing.  This handle specifies the controller  | ||||
|                        whose name is to be returned. | ||||
|     ChildHandle      - The handle of the child controller to retrieve the name  | ||||
|                        of.  This is an optional parameter that may be NULL.  It  | ||||
|                        will be NULL for device drivers.  It will also be NULL  | ||||
|                        for a bus drivers that wish to retrieve the name of the  | ||||
|                        bus controller.  It will not be NULL for a bus driver  | ||||
|                        that wishes to retrieve the name of a child controller. | ||||
|     Language         - A pointer to a three character ISO 639-2 language  | ||||
|                        identifier.  This is the language of the controller name  | ||||
|                        that that the caller is requesting, and it must match one | ||||
|                        of the languages specified in SupportedLanguages.  The  | ||||
|                        number of languages supported by a driver is up to the  | ||||
|                        driver writer. | ||||
|     ControllerName   - A pointer to the Unicode string to return.  This Unicode | ||||
|                        string is the name of the controller specified by  | ||||
|                        ControllerHandle and ChildHandle in the language  | ||||
|                        specified by Language from the point of view of the  | ||||
|                        driver specified by This.  | ||||
|  | ||||
|   Returns: | ||||
|     EFI_SUCCESS           - The Unicode string for the user readable name in the  | ||||
|                             language specified by Language for the driver  | ||||
|                             specified by This was returned in DriverName. | ||||
|     EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE. | ||||
|     EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid  | ||||
|                             EFI_HANDLE. | ||||
|     EFI_INVALID_PARAMETER - Language is NULL. | ||||
|     EFI_INVALID_PARAMETER - ControllerName is NULL. | ||||
|     EFI_UNSUPPORTED       - The driver specified by This is not currently  | ||||
|                             managing the controller specified by  | ||||
|                             ControllerHandle and ChildHandle. | ||||
|     EFI_UNSUPPORTED       - The driver specified by This does not support the  | ||||
|                             language specified by Language. | ||||
|  | ||||
| --*/ | ||||
| { | ||||
|   return EFI_UNSUPPORTED; | ||||
| } | ||||
|   | ||||
| @@ -20,36 +20,127 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. | ||||
| #include "InternalIsaBus.h" | ||||
|  | ||||
| extern EFI_COMPONENT_NAME_PROTOCOL   gIsaBusComponentName; | ||||
| extern EFI_COMPONENT_NAME2_PROTOCOL  gIsaBusComponentName2; | ||||
|  | ||||
| // | ||||
| // EFI Component Name Functions | ||||
| // | ||||
| /** | ||||
|   Retrieves a Unicode string that is the user readable name of the driver. | ||||
|  | ||||
|   This function retrieves the user readable name of a driver in the form of a | ||||
|   Unicode string. If the driver specified by This has a user readable name in | ||||
|   the language specified by Language, then a pointer to the driver name is | ||||
|   returned in DriverName, and EFI_SUCCESS is returned. If the driver specified | ||||
|   by This does not support the language specified by Language, | ||||
|   then EFI_UNSUPPORTED is returned. | ||||
|  | ||||
|   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | ||||
|                                 EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|  | ||||
|   @param  Language[in]          A pointer to a Null-terminated ASCII string | ||||
|                                 array indicating the language. This is the | ||||
|                                 language of the driver name that the caller is | ||||
|                                 requesting, and it must match one of the | ||||
|                                 languages specified in SupportedLanguages. The | ||||
|                                 number of languages supported by a driver is up | ||||
|                                 to the driver writer. Language is specified | ||||
|                                 in RFC 3066 or ISO 639-2 language code format. | ||||
|  | ||||
|   @param  DriverName[out]       A pointer to the Unicode string to return. | ||||
|                                 This Unicode string is the name of the | ||||
|                                 driver specified by This in the language | ||||
|                                 specified by Language. | ||||
|  | ||||
|   @retval EFI_SUCCESS           The Unicode string for the Driver specified by | ||||
|                                 This and the language specified by Language was | ||||
|                                 returned in DriverName. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER Language is NULL. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER DriverName is NULL. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This does not support | ||||
|                                 the language specified by Language. | ||||
|  | ||||
| **/ | ||||
| EFI_STATUS | ||||
| EFIAPI | ||||
| IsaBusComponentNameGetDriverName ( | ||||
|   IN  EFI_COMPONENT_NAME_PROTOCOL  *This, | ||||
|   IN  CHAR8                        *Language, | ||||
|   OUT CHAR16                       **DriverName | ||||
|   ) | ||||
| /*++ | ||||
|   ); | ||||
|  | ||||
| Routine Description: | ||||
|  | ||||
|   GC_TODO: Add function description | ||||
| /** | ||||
|   Retrieves a Unicode string that is the user readable name of the controller | ||||
|   that is being managed by a driver. | ||||
|  | ||||
| Arguments: | ||||
|   This function retrieves the user readable name of the controller specified by | ||||
|   ControllerHandle and ChildHandle in the form of a Unicode string. If the | ||||
|   driver specified by This has a user readable name in the language specified by | ||||
|   Language, then a pointer to the controller name is returned in ControllerName, | ||||
|   and EFI_SUCCESS is returned.  If the driver specified by This is not currently | ||||
|   managing the controller specified by ControllerHandle and ChildHandle, | ||||
|   then EFI_UNSUPPORTED is returned.  If the driver specified by This does not | ||||
|   support the language specified by Language, then EFI_UNSUPPORTED is returned. | ||||
|  | ||||
|   This        - GC_TODO: add argument description | ||||
|   Language    - GC_TODO: add argument description | ||||
|   DriverName  - GC_TODO: add argument description | ||||
|   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | ||||
|                                 EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|  | ||||
| Returns: | ||||
|   @param  ControllerHandle[in]  The handle of a controller that the driver | ||||
|                                 specified by This is managing.  This handle | ||||
|                                 specifies the controller whose name is to be | ||||
|                                 returned. | ||||
|  | ||||
|   GC_TODO: add return values | ||||
|   @param  ChildHandle[in]       The handle of the child controller to retrieve | ||||
|                                 the name of.  This is an optional parameter that | ||||
|                                 may be NULL.  It will be NULL for device | ||||
|                                 drivers.  It will also be NULL for a bus drivers | ||||
|                                 that wish to retrieve the name of the bus | ||||
|                                 controller.  It will not be NULL for a bus | ||||
|                                 driver that wishes to retrieve the name of a | ||||
|                                 child controller. | ||||
|  | ||||
| --*/ | ||||
| ; | ||||
|   @param  Language[in]          A pointer to a Null-terminated ASCII string | ||||
|                                 array indicating the language.  This is the | ||||
|                                 language of the driver name that the caller is | ||||
|                                 requesting, and it must match one of the | ||||
|                                 languages specified in SupportedLanguages. The | ||||
|                                 number of languages supported by a driver is up | ||||
|                                 to the driver writer. Language is specified in | ||||
|                                 RFC 3066 or ISO 639-2 language code format. | ||||
|  | ||||
|   @param  ControllerName[out]   A pointer to the Unicode string to return. | ||||
|                                 This Unicode string is the name of the | ||||
|                                 controller specified by ControllerHandle and | ||||
|                                 ChildHandle in the language specified by | ||||
|                                 Language from the point of view of the driver | ||||
|                                 specified by This. | ||||
|  | ||||
|   @retval EFI_SUCCESS           The Unicode string for the user readable name in | ||||
|                                 the language specified by Language for the | ||||
|                                 driver specified by This was returned in | ||||
|                                 DriverName. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid | ||||
|                                 EFI_HANDLE. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER Language is NULL. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ControllerName is NULL. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This is not currently | ||||
|                                 managing the controller specified by | ||||
|                                 ControllerHandle and ChildHandle. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This does not support | ||||
|                                 the language specified by Language. | ||||
|  | ||||
| **/ | ||||
| EFI_STATUS | ||||
| EFIAPI | ||||
| IsaBusComponentNameGetControllerName ( | ||||
| @@ -58,26 +149,7 @@ IsaBusComponentNameGetControllerName ( | ||||
|   IN  EFI_HANDLE                                      ChildHandle        OPTIONAL, | ||||
|   IN  CHAR8                                           *Language, | ||||
|   OUT CHAR16                                          **ControllerName | ||||
|   ) | ||||
| /*++ | ||||
|   ); | ||||
|  | ||||
| Routine Description: | ||||
|  | ||||
|   GC_TODO: Add function description | ||||
|  | ||||
| Arguments: | ||||
|  | ||||
|   This              - GC_TODO: add argument description | ||||
|   ControllerHandle  - GC_TODO: add argument description | ||||
|   ChildHandle       - GC_TODO: add argument description | ||||
|   Language          - GC_TODO: add argument description | ||||
|   ControllerName    - GC_TODO: add argument description | ||||
|  | ||||
| Returns: | ||||
|  | ||||
|   GC_TODO: add return values | ||||
|  | ||||
| --*/ | ||||
| ; | ||||
|  | ||||
| #endif | ||||
|   | ||||
| @@ -55,14 +55,13 @@ InitializeIsaBus( | ||||
|   // | ||||
|   // Install driver model protocol(s). | ||||
|   // | ||||
|   Status = EfiLibInstallAllDriverProtocols ( | ||||
|   Status = EfiLibInstallDriverBindingComponentName2 ( | ||||
|              ImageHandle, | ||||
|              SystemTable, | ||||
|              &gIsaBusControllerDriver, | ||||
|              ImageHandle, | ||||
|              &gIsaBusComponentName, | ||||
|              NULL, | ||||
|              NULL | ||||
|              &gIsaBusComponentName2 | ||||
|              ); | ||||
|   ASSERT_EFI_ERROR (Status); | ||||
|  | ||||
|   | ||||
| @@ -23,9 +23,19 @@ EFI_COMPONENT_NAME_PROTOCOL     gIsaFloppyComponentName = { | ||||
|   "eng" | ||||
|   }; | ||||
|  | ||||
| // | ||||
| // EFI Component Name 2 Protocol | ||||
| // | ||||
| EFI_COMPONENT_NAME2_PROTOCOL gIsaFloppyComponentName2 = { | ||||
|   (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) IsaFloppyComponentNameGetDriverName, | ||||
|   (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) IsaFloppyComponentNameGetControllerName, | ||||
|   "en" | ||||
|   }; | ||||
|  | ||||
|  | ||||
| STATIC EFI_UNICODE_STRING_TABLE mIsaFloppyDriverNameTable[] = { | ||||
|   { | ||||
|     "eng", | ||||
|     "eng;en", | ||||
|     L"ISA Floppy Driver" | ||||
|   }, | ||||
|   { | ||||
| @@ -34,6 +44,45 @@ STATIC EFI_UNICODE_STRING_TABLE mIsaFloppyDriverNameTable[] = { | ||||
|   } | ||||
| }; | ||||
|  | ||||
| /** | ||||
|   Retrieves a Unicode string that is the user readable name of the driver. | ||||
|  | ||||
|   This function retrieves the user readable name of a driver in the form of a | ||||
|   Unicode string. If the driver specified by This has a user readable name in | ||||
|   the language specified by Language, then a pointer to the driver name is | ||||
|   returned in DriverName, and EFI_SUCCESS is returned. If the driver specified | ||||
|   by This does not support the language specified by Language, | ||||
|   then EFI_UNSUPPORTED is returned. | ||||
|  | ||||
|   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | ||||
|                                 EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|  | ||||
|   @param  Language[in]          A pointer to a Null-terminated ASCII string | ||||
|                                 array indicating the language. This is the | ||||
|                                 language of the driver name that the caller is | ||||
|                                 requesting, and it must match one of the | ||||
|                                 languages specified in SupportedLanguages. The | ||||
|                                 number of languages supported by a driver is up | ||||
|                                 to the driver writer. Language is specified | ||||
|                                 in RFC 3066 or ISO 639-2 language code format. | ||||
|  | ||||
|   @param  DriverName[out]       A pointer to the Unicode string to return. | ||||
|                                 This Unicode string is the name of the | ||||
|                                 driver specified by This in the language | ||||
|                                 specified by Language. | ||||
|  | ||||
|   @retval EFI_SUCCESS           The Unicode string for the Driver specified by | ||||
|                                 This and the language specified by Language was | ||||
|                                 returned in DriverName. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER Language is NULL. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER DriverName is NULL. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This does not support | ||||
|                                 the language specified by Language. | ||||
|  | ||||
| **/ | ||||
| EFI_STATUS | ||||
| EFIAPI | ||||
| IsaFloppyComponentNameGetDriverName ( | ||||
| @@ -41,44 +90,84 @@ IsaFloppyComponentNameGetDriverName ( | ||||
|   IN  CHAR8                        *Language, | ||||
|   OUT CHAR16                       **DriverName | ||||
|   ) | ||||
| /*++ | ||||
|  | ||||
|   Routine Description: | ||||
|    | ||||
|     Retrieves a Unicode string that is the user readable name of the EFI Driver. | ||||
|  | ||||
|   Arguments: | ||||
|    | ||||
|     This       - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|     Language   - A pointer to a three character ISO 639-2 language identifier. | ||||
|                  This is the language of the driver name that that the caller  | ||||
|                  is requesting, and it must match one of the languages specified | ||||
|                  in SupportedLanguages.  The number of languages supported by a  | ||||
|                  driver is up to the driver writer. | ||||
|     DriverName - A pointer to the Unicode string to return.  This Unicode string | ||||
|                  is the name of the driver specified by This in the language  | ||||
|                  specified by Language. | ||||
|  | ||||
|   Returns: | ||||
|    | ||||
|     EFI_SUCCESS           - The Unicode string for the Driver specified by This | ||||
|                             and the language specified by Language was returned  | ||||
|                             in DriverName. | ||||
|     EFI_INVALID_PARAMETER - Language is NULL. | ||||
|     EFI_INVALID_PARAMETER - DriverName is NULL. | ||||
|     EFI_UNSUPPORTED       - The driver specified by This does not support the  | ||||
|                             language specified by Language. | ||||
|  | ||||
| --*/ | ||||
| { | ||||
|   return LookupUnicodeString ( | ||||
|   return LookupUnicodeString2 ( | ||||
|            Language, | ||||
|            gIsaFloppyComponentName.SupportedLanguages, | ||||
|            This->SupportedLanguages, | ||||
|            mIsaFloppyDriverNameTable, | ||||
|            DriverName | ||||
|            DriverName, | ||||
|            (BOOLEAN)(This == &gIsaFloppyComponentName) | ||||
|            ); | ||||
| } | ||||
|  | ||||
| /** | ||||
|   Retrieves a Unicode string that is the user readable name of the controller | ||||
|   that is being managed by a driver. | ||||
|  | ||||
|   This function retrieves the user readable name of the controller specified by | ||||
|   ControllerHandle and ChildHandle in the form of a Unicode string. If the | ||||
|   driver specified by This has a user readable name in the language specified by | ||||
|   Language, then a pointer to the controller name is returned in ControllerName, | ||||
|   and EFI_SUCCESS is returned.  If the driver specified by This is not currently | ||||
|   managing the controller specified by ControllerHandle and ChildHandle, | ||||
|   then EFI_UNSUPPORTED is returned.  If the driver specified by This does not | ||||
|   support the language specified by Language, then EFI_UNSUPPORTED is returned. | ||||
|  | ||||
|   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | ||||
|                                 EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|  | ||||
|   @param  ControllerHandle[in]  The handle of a controller that the driver | ||||
|                                 specified by This is managing.  This handle | ||||
|                                 specifies the controller whose name is to be | ||||
|                                 returned. | ||||
|  | ||||
|   @param  ChildHandle[in]       The handle of the child controller to retrieve | ||||
|                                 the name of.  This is an optional parameter that | ||||
|                                 may be NULL.  It will be NULL for device | ||||
|                                 drivers.  It will also be NULL for a bus drivers | ||||
|                                 that wish to retrieve the name of the bus | ||||
|                                 controller.  It will not be NULL for a bus | ||||
|                                 driver that wishes to retrieve the name of a | ||||
|                                 child controller. | ||||
|  | ||||
|   @param  Language[in]          A pointer to a Null-terminated ASCII string | ||||
|                                 array indicating the language.  This is the | ||||
|                                 language of the driver name that the caller is | ||||
|                                 requesting, and it must match one of the | ||||
|                                 languages specified in SupportedLanguages. The | ||||
|                                 number of languages supported by a driver is up | ||||
|                                 to the driver writer. Language is specified in | ||||
|                                 RFC 3066 or ISO 639-2 language code format. | ||||
|  | ||||
|   @param  ControllerName[out]   A pointer to the Unicode string to return. | ||||
|                                 This Unicode string is the name of the | ||||
|                                 controller specified by ControllerHandle and | ||||
|                                 ChildHandle in the language specified by | ||||
|                                 Language from the point of view of the driver | ||||
|                                 specified by This. | ||||
|  | ||||
|   @retval EFI_SUCCESS           The Unicode string for the user readable name in | ||||
|                                 the language specified by Language for the | ||||
|                                 driver specified by This was returned in | ||||
|                                 DriverName. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid | ||||
|                                 EFI_HANDLE. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER Language is NULL. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ControllerName is NULL. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This is not currently | ||||
|                                 managing the controller specified by | ||||
|                                 ControllerHandle and ChildHandle. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This does not support | ||||
|                                 the language specified by Language. | ||||
|  | ||||
| **/ | ||||
| EFI_STATUS | ||||
| EFIAPI | ||||
| IsaFloppyComponentNameGetControllerName ( | ||||
| @@ -88,54 +177,6 @@ IsaFloppyComponentNameGetControllerName ( | ||||
|   IN  CHAR8                                           *Language, | ||||
|   OUT CHAR16                                          **ControllerName | ||||
|   ) | ||||
| /*++ | ||||
|  | ||||
|   Routine Description: | ||||
|    | ||||
|     Retrieves a Unicode string that is the user readable name of the controller | ||||
|     that is being managed by an EFI Driver. | ||||
|  | ||||
|   Arguments: | ||||
|    | ||||
|     This             - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|     ControllerHandle - The handle of a controller that the driver specified by  | ||||
|                        This is managing.  This handle specifies the controller  | ||||
|                        whose name is to be returned. | ||||
|     ChildHandle      - The handle of the child controller to retrieve the name  | ||||
|                        of.  This is an optional parameter that may be NULL.  It  | ||||
|                        will be NULL for device drivers.  It will also be NULL  | ||||
|                        for a bus drivers that wish to retrieve the name of the  | ||||
|                        bus controller.  It will not be NULL for a bus driver  | ||||
|                        that wishes to retrieve the name of a child controller. | ||||
|     Language         - A pointer to a three character ISO 639-2 language  | ||||
|                        identifier.  This is the language of the controller name  | ||||
|                        that that the caller is requesting, and it must match one | ||||
|                        of the languages specified in SupportedLanguages.  The  | ||||
|                        number of languages supported by a driver is up to the  | ||||
|                        driver writer. | ||||
|     ControllerName   - A pointer to the Unicode string to return.  This Unicode | ||||
|                        string is the name of the controller specified by  | ||||
|                        ControllerHandle and ChildHandle in the language  | ||||
|                        specified by Language from the point of view of the  | ||||
|                        driver specified by This.  | ||||
|  | ||||
|   Returns: | ||||
|    | ||||
|     EFI_SUCCESS           - The Unicode string for the user readable name in the  | ||||
|                             language specified by Language for the driver  | ||||
|                             specified by This was returned in DriverName. | ||||
|     EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE. | ||||
|     EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid  | ||||
|                             EFI_HANDLE. | ||||
|     EFI_INVALID_PARAMETER - Language is NULL. | ||||
|     EFI_INVALID_PARAMETER - ControllerName is NULL. | ||||
|     EFI_UNSUPPORTED       - The driver specified by This is not currently  | ||||
|                             managing the controller specified by  | ||||
|                             ControllerHandle and ChildHandle. | ||||
|     EFI_UNSUPPORTED       - The driver specified by This does not support the  | ||||
|                             language specified by Language. | ||||
|  | ||||
| --*/ | ||||
| { | ||||
|   EFI_STATUS                            Status; | ||||
|   EFI_BLOCK_IO_PROTOCOL                 *BlkIo; | ||||
| @@ -192,11 +233,12 @@ IsaFloppyComponentNameGetControllerName ( | ||||
|   // | ||||
|   FdcDev = FDD_BLK_IO_FROM_THIS (BlkIo); | ||||
|  | ||||
|   return LookupUnicodeString ( | ||||
|   return LookupUnicodeString2 ( | ||||
|            Language, | ||||
|            gIsaFloppyComponentName.SupportedLanguages, | ||||
|            This->SupportedLanguages, | ||||
|            FdcDev->ControllerNameTable, | ||||
|            ControllerName | ||||
|            ControllerName, | ||||
|            (BOOLEAN)(This == &gIsaFloppyComponentName) | ||||
|            ); | ||||
| } | ||||
|  | ||||
| @@ -224,10 +266,19 @@ AddName ( | ||||
|  | ||||
|   StrCpy (FloppyDriveName, FLOPPY_DRIVE_NAME); | ||||
|   FloppyDriveName[FLOPPY_DRIVE_NAME_ASCII_LEN - 1] = (CHAR16) (L'0' + FdcDev->Disk); | ||||
|   AddUnicodeString ( | ||||
|   AddUnicodeString2 ( | ||||
|     "eng", | ||||
|     gIsaFloppyComponentName.SupportedLanguages, | ||||
|     &FdcDev->ControllerNameTable, | ||||
|     FloppyDriveName | ||||
|     FloppyDriveName, | ||||
|     TRUE | ||||
|     ); | ||||
|   AddUnicodeString2 ( | ||||
|     "en", | ||||
|     gIsaFloppyComponentName2.SupportedLanguages, | ||||
|     &FdcDev->ControllerNameTable, | ||||
|     FloppyDriveName, | ||||
|     FALSE | ||||
|     ); | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -20,36 +20,127 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. | ||||
| #define ADD_FLOPPY_NAME(x)                 AddName ((x)) | ||||
|  | ||||
| extern EFI_COMPONENT_NAME_PROTOCOL   gIsaFloppyComponentName; | ||||
| extern EFI_COMPONENT_NAME2_PROTOCOL  gIsaFloppyComponentName2; | ||||
|  | ||||
| // | ||||
| // EFI Component Name Functions | ||||
| // | ||||
| /** | ||||
|   Retrieves a Unicode string that is the user readable name of the driver. | ||||
|  | ||||
|   This function retrieves the user readable name of a driver in the form of a | ||||
|   Unicode string. If the driver specified by This has a user readable name in | ||||
|   the language specified by Language, then a pointer to the driver name is | ||||
|   returned in DriverName, and EFI_SUCCESS is returned. If the driver specified | ||||
|   by This does not support the language specified by Language, | ||||
|   then EFI_UNSUPPORTED is returned. | ||||
|  | ||||
|   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | ||||
|                                 EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|  | ||||
|   @param  Language[in]          A pointer to a Null-terminated ASCII string | ||||
|                                 array indicating the language. This is the | ||||
|                                 language of the driver name that the caller is | ||||
|                                 requesting, and it must match one of the | ||||
|                                 languages specified in SupportedLanguages. The | ||||
|                                 number of languages supported by a driver is up | ||||
|                                 to the driver writer. Language is specified | ||||
|                                 in RFC 3066 or ISO 639-2 language code format. | ||||
|  | ||||
|   @param  DriverName[out]       A pointer to the Unicode string to return. | ||||
|                                 This Unicode string is the name of the | ||||
|                                 driver specified by This in the language | ||||
|                                 specified by Language. | ||||
|  | ||||
|   @retval EFI_SUCCESS           The Unicode string for the Driver specified by | ||||
|                                 This and the language specified by Language was | ||||
|                                 returned in DriverName. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER Language is NULL. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER DriverName is NULL. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This does not support | ||||
|                                 the language specified by Language. | ||||
|  | ||||
| **/ | ||||
| EFI_STATUS | ||||
| EFIAPI | ||||
| IsaFloppyComponentNameGetDriverName ( | ||||
|   IN  EFI_COMPONENT_NAME_PROTOCOL  *This, | ||||
|   IN  CHAR8                        *Language, | ||||
|   OUT CHAR16                       **DriverName | ||||
|   ) | ||||
| /*++ | ||||
|   ); | ||||
|  | ||||
| Routine Description: | ||||
|  | ||||
|   GC_TODO: Add function description | ||||
| /** | ||||
|   Retrieves a Unicode string that is the user readable name of the controller | ||||
|   that is being managed by a driver. | ||||
|  | ||||
| Arguments: | ||||
|   This function retrieves the user readable name of the controller specified by | ||||
|   ControllerHandle and ChildHandle in the form of a Unicode string. If the | ||||
|   driver specified by This has a user readable name in the language specified by | ||||
|   Language, then a pointer to the controller name is returned in ControllerName, | ||||
|   and EFI_SUCCESS is returned.  If the driver specified by This is not currently | ||||
|   managing the controller specified by ControllerHandle and ChildHandle, | ||||
|   then EFI_UNSUPPORTED is returned.  If the driver specified by This does not | ||||
|   support the language specified by Language, then EFI_UNSUPPORTED is returned. | ||||
|  | ||||
|   This        - GC_TODO: add argument description | ||||
|   Language    - GC_TODO: add argument description | ||||
|   DriverName  - GC_TODO: add argument description | ||||
|   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | ||||
|                                 EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|  | ||||
| Returns: | ||||
|   @param  ControllerHandle[in]  The handle of a controller that the driver | ||||
|                                 specified by This is managing.  This handle | ||||
|                                 specifies the controller whose name is to be | ||||
|                                 returned. | ||||
|  | ||||
|   GC_TODO: add return values | ||||
|   @param  ChildHandle[in]       The handle of the child controller to retrieve | ||||
|                                 the name of.  This is an optional parameter that | ||||
|                                 may be NULL.  It will be NULL for device | ||||
|                                 drivers.  It will also be NULL for a bus drivers | ||||
|                                 that wish to retrieve the name of the bus | ||||
|                                 controller.  It will not be NULL for a bus | ||||
|                                 driver that wishes to retrieve the name of a | ||||
|                                 child controller. | ||||
|  | ||||
| --*/ | ||||
| ; | ||||
|   @param  Language[in]          A pointer to a Null-terminated ASCII string | ||||
|                                 array indicating the language.  This is the | ||||
|                                 language of the driver name that the caller is | ||||
|                                 requesting, and it must match one of the | ||||
|                                 languages specified in SupportedLanguages. The | ||||
|                                 number of languages supported by a driver is up | ||||
|                                 to the driver writer. Language is specified in | ||||
|                                 RFC 3066 or ISO 639-2 language code format. | ||||
|  | ||||
|   @param  ControllerName[out]   A pointer to the Unicode string to return. | ||||
|                                 This Unicode string is the name of the | ||||
|                                 controller specified by ControllerHandle and | ||||
|                                 ChildHandle in the language specified by | ||||
|                                 Language from the point of view of the driver | ||||
|                                 specified by This. | ||||
|  | ||||
|   @retval EFI_SUCCESS           The Unicode string for the user readable name in | ||||
|                                 the language specified by Language for the | ||||
|                                 driver specified by This was returned in | ||||
|                                 DriverName. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid | ||||
|                                 EFI_HANDLE. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER Language is NULL. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ControllerName is NULL. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This is not currently | ||||
|                                 managing the controller specified by | ||||
|                                 ControllerHandle and ChildHandle. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This does not support | ||||
|                                 the language specified by Language. | ||||
|  | ||||
| **/ | ||||
| EFI_STATUS | ||||
| EFIAPI | ||||
| IsaFloppyComponentNameGetControllerName ( | ||||
| @@ -58,27 +149,8 @@ IsaFloppyComponentNameGetControllerName ( | ||||
|   IN  EFI_HANDLE                                      ChildHandle        OPTIONAL, | ||||
|   IN  CHAR8                                           *Language, | ||||
|   OUT CHAR16                                          **ControllerName | ||||
|   ) | ||||
| /*++ | ||||
|   ); | ||||
|  | ||||
| Routine Description: | ||||
|  | ||||
|   GC_TODO: Add function description | ||||
|  | ||||
| Arguments: | ||||
|  | ||||
|   This              - GC_TODO: add argument description | ||||
|   ControllerHandle  - GC_TODO: add argument description | ||||
|   ChildHandle       - GC_TODO: add argument description | ||||
|   Language          - GC_TODO: add argument description | ||||
|   ControllerName    - GC_TODO: add argument description | ||||
|  | ||||
| Returns: | ||||
|  | ||||
|   GC_TODO: add return values | ||||
|  | ||||
| --*/ | ||||
| ; | ||||
|  | ||||
| VOID | ||||
| AddName ( | ||||
|   | ||||
| @@ -59,14 +59,13 @@ InitializeIsaFloppy( | ||||
|   // | ||||
|   // Install driver model protocol(s). | ||||
|   // | ||||
|   Status = EfiLibInstallAllDriverProtocols ( | ||||
|   Status = EfiLibInstallDriverBindingComponentName2 ( | ||||
|              ImageHandle, | ||||
|              SystemTable, | ||||
|              &gFdcControllerDriver, | ||||
|              ImageHandle, | ||||
|              &gIsaFloppyComponentName, | ||||
|              NULL, | ||||
|              NULL | ||||
|              &gIsaFloppyComponentName2 | ||||
|              ); | ||||
|   ASSERT_EFI_ERROR (Status); | ||||
|  | ||||
|   | ||||
| @@ -37,6 +37,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. | ||||
| // | ||||
| extern EFI_DRIVER_BINDING_PROTOCOL  gFdcControllerDriver; | ||||
| extern EFI_COMPONENT_NAME_PROTOCOL  gIsaFloppyComponentName; | ||||
| extern EFI_COMPONENT_NAME2_PROTOCOL gIsaFloppyComponentName2; | ||||
|  | ||||
| // | ||||
| // define some value | ||||
|   | ||||
| @@ -23,9 +23,19 @@ EFI_COMPONENT_NAME_PROTOCOL     gIsaSerialComponentName = { | ||||
|   "eng" | ||||
|   }; | ||||
|  | ||||
| // | ||||
| // EFI Component Name 2 Protocol | ||||
| // | ||||
| EFI_COMPONENT_NAME2_PROTOCOL gIsaSerialComponentName2 = { | ||||
|   (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) IsaSerialComponentNameGetDriverName, | ||||
|   (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) IsaSerialComponentNameGetControllerName, | ||||
|   "en" | ||||
|   }; | ||||
|  | ||||
|  | ||||
| STATIC EFI_UNICODE_STRING_TABLE mIsaSerialDriverNameTable[] = { | ||||
|   { | ||||
|     "eng", | ||||
|     "eng;en", | ||||
|     L"ISA Serial Driver" | ||||
|   }, | ||||
|   { | ||||
| @@ -34,6 +44,45 @@ STATIC EFI_UNICODE_STRING_TABLE mIsaSerialDriverNameTable[] = { | ||||
|   } | ||||
| }; | ||||
|  | ||||
| /** | ||||
|   Retrieves a Unicode string that is the user readable name of the driver. | ||||
|  | ||||
|   This function retrieves the user readable name of a driver in the form of a | ||||
|   Unicode string. If the driver specified by This has a user readable name in | ||||
|   the language specified by Language, then a pointer to the driver name is | ||||
|   returned in DriverName, and EFI_SUCCESS is returned. If the driver specified | ||||
|   by This does not support the language specified by Language, | ||||
|   then EFI_UNSUPPORTED is returned. | ||||
|  | ||||
|   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | ||||
|                                 EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|  | ||||
|   @param  Language[in]          A pointer to a Null-terminated ASCII string | ||||
|                                 array indicating the language. This is the | ||||
|                                 language of the driver name that the caller is | ||||
|                                 requesting, and it must match one of the | ||||
|                                 languages specified in SupportedLanguages. The | ||||
|                                 number of languages supported by a driver is up | ||||
|                                 to the driver writer. Language is specified | ||||
|                                 in RFC 3066 or ISO 639-2 language code format. | ||||
|  | ||||
|   @param  DriverName[out]       A pointer to the Unicode string to return. | ||||
|                                 This Unicode string is the name of the | ||||
|                                 driver specified by This in the language | ||||
|                                 specified by Language. | ||||
|  | ||||
|   @retval EFI_SUCCESS           The Unicode string for the Driver specified by | ||||
|                                 This and the language specified by Language was | ||||
|                                 returned in DriverName. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER Language is NULL. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER DriverName is NULL. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This does not support | ||||
|                                 the language specified by Language. | ||||
|  | ||||
| **/ | ||||
| EFI_STATUS | ||||
| EFIAPI | ||||
| IsaSerialComponentNameGetDriverName ( | ||||
| @@ -41,44 +90,84 @@ IsaSerialComponentNameGetDriverName ( | ||||
|   IN  CHAR8                        *Language, | ||||
|   OUT CHAR16                       **DriverName | ||||
|   ) | ||||
| /*++ | ||||
|  | ||||
|   Routine Description: | ||||
|    | ||||
|     Retrieves a Unicode string that is the user readable name of the EFI Driver. | ||||
|  | ||||
|   Arguments: | ||||
|    | ||||
|     This       - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|     Language   - A pointer to a three character ISO 639-2 language identifier. | ||||
|                  This is the language of the driver name that that the caller  | ||||
|                  is requesting, and it must match one of the languages specified | ||||
|                  in SupportedLanguages.  The number of languages supported by a  | ||||
|                  driver is up to the driver writer. | ||||
|     DriverName - A pointer to the Unicode string to return.  This Unicode string | ||||
|                  is the name of the driver specified by This in the language  | ||||
|                  specified by Language. | ||||
|  | ||||
|   Returns: | ||||
|    | ||||
|     EFI_SUCCESS           - The Unicode string for the Driver specified by This | ||||
|                             and the language specified by Language was returned  | ||||
|                             in DriverName. | ||||
|     EFI_INVALID_PARAMETER - Language is NULL. | ||||
|     EFI_INVALID_PARAMETER - DriverName is NULL. | ||||
|     EFI_UNSUPPORTED       - The driver specified by This does not support the  | ||||
|                             language specified by Language. | ||||
|  | ||||
| --*/ | ||||
| { | ||||
|   return LookupUnicodeString ( | ||||
|   return LookupUnicodeString2 ( | ||||
|            Language, | ||||
|            gIsaSerialComponentName.SupportedLanguages, | ||||
|            This->SupportedLanguages, | ||||
|            mIsaSerialDriverNameTable, | ||||
|            DriverName | ||||
|            DriverName, | ||||
|            (BOOLEAN)(This == &gIsaSerialComponentName) | ||||
|            ); | ||||
| } | ||||
|  | ||||
| /** | ||||
|   Retrieves a Unicode string that is the user readable name of the controller | ||||
|   that is being managed by a driver. | ||||
|  | ||||
|   This function retrieves the user readable name of the controller specified by | ||||
|   ControllerHandle and ChildHandle in the form of a Unicode string. If the | ||||
|   driver specified by This has a user readable name in the language specified by | ||||
|   Language, then a pointer to the controller name is returned in ControllerName, | ||||
|   and EFI_SUCCESS is returned.  If the driver specified by This is not currently | ||||
|   managing the controller specified by ControllerHandle and ChildHandle, | ||||
|   then EFI_UNSUPPORTED is returned.  If the driver specified by This does not | ||||
|   support the language specified by Language, then EFI_UNSUPPORTED is returned. | ||||
|  | ||||
|   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | ||||
|                                 EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|  | ||||
|   @param  ControllerHandle[in]  The handle of a controller that the driver | ||||
|                                 specified by This is managing.  This handle | ||||
|                                 specifies the controller whose name is to be | ||||
|                                 returned. | ||||
|  | ||||
|   @param  ChildHandle[in]       The handle of the child controller to retrieve | ||||
|                                 the name of.  This is an optional parameter that | ||||
|                                 may be NULL.  It will be NULL for device | ||||
|                                 drivers.  It will also be NULL for a bus drivers | ||||
|                                 that wish to retrieve the name of the bus | ||||
|                                 controller.  It will not be NULL for a bus | ||||
|                                 driver that wishes to retrieve the name of a | ||||
|                                 child controller. | ||||
|  | ||||
|   @param  Language[in]          A pointer to a Null-terminated ASCII string | ||||
|                                 array indicating the language.  This is the | ||||
|                                 language of the driver name that the caller is | ||||
|                                 requesting, and it must match one of the | ||||
|                                 languages specified in SupportedLanguages. The | ||||
|                                 number of languages supported by a driver is up | ||||
|                                 to the driver writer. Language is specified in | ||||
|                                 RFC 3066 or ISO 639-2 language code format. | ||||
|  | ||||
|   @param  ControllerName[out]   A pointer to the Unicode string to return. | ||||
|                                 This Unicode string is the name of the | ||||
|                                 controller specified by ControllerHandle and | ||||
|                                 ChildHandle in the language specified by | ||||
|                                 Language from the point of view of the driver | ||||
|                                 specified by This. | ||||
|  | ||||
|   @retval EFI_SUCCESS           The Unicode string for the user readable name in | ||||
|                                 the language specified by Language for the | ||||
|                                 driver specified by This was returned in | ||||
|                                 DriverName. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid | ||||
|                                 EFI_HANDLE. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER Language is NULL. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ControllerName is NULL. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This is not currently | ||||
|                                 managing the controller specified by | ||||
|                                 ControllerHandle and ChildHandle. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This does not support | ||||
|                                 the language specified by Language. | ||||
|  | ||||
| **/ | ||||
| EFI_STATUS | ||||
| EFIAPI | ||||
| IsaSerialComponentNameGetControllerName ( | ||||
| @@ -88,54 +177,6 @@ IsaSerialComponentNameGetControllerName ( | ||||
|   IN  CHAR8                                           *Language, | ||||
|   OUT CHAR16                                          **ControllerName | ||||
|   ) | ||||
| /*++ | ||||
|  | ||||
|   Routine Description: | ||||
|    | ||||
|     Retrieves a Unicode string that is the user readable name of the controller | ||||
|     that is being managed by an EFI Driver. | ||||
|  | ||||
|   Arguments: | ||||
|    | ||||
|     This             - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|     ControllerHandle - The handle of a controller that the driver specified by  | ||||
|                        This is managing.  This handle specifies the controller  | ||||
|                        whose name is to be returned. | ||||
|     ChildHandle      - The handle of the child controller to retrieve the name  | ||||
|                        of.  This is an optional parameter that may be NULL.  It  | ||||
|                        will be NULL for device drivers.  It will also be NULL  | ||||
|                        for a bus drivers that wish to retrieve the name of the  | ||||
|                        bus controller.  It will not be NULL for a bus driver  | ||||
|                        that wishes to retrieve the name of a child controller. | ||||
|     Language         - A pointer to a three character ISO 639-2 language  | ||||
|                        identifier.  This is the language of the controller name  | ||||
|                        that that the caller is requesting, and it must match one | ||||
|                        of the languages specified in SupportedLanguages.  The  | ||||
|                        number of languages supported by a driver is up to the  | ||||
|                        driver writer. | ||||
|     ControllerName   - A pointer to the Unicode string to return.  This Unicode | ||||
|                        string is the name of the controller specified by  | ||||
|                        ControllerHandle and ChildHandle in the language  | ||||
|                        specified by Language from the point of view of the  | ||||
|                        driver specified by This.  | ||||
|  | ||||
|   Returns: | ||||
|    | ||||
|     EFI_SUCCESS           - The Unicode string for the user readable name in the  | ||||
|                             language specified by Language for the driver  | ||||
|                             specified by This was returned in DriverName. | ||||
|     EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE. | ||||
|     EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid  | ||||
|                             EFI_HANDLE. | ||||
|     EFI_INVALID_PARAMETER - Language is NULL. | ||||
|     EFI_INVALID_PARAMETER - ControllerName is NULL. | ||||
|     EFI_UNSUPPORTED       - The driver specified by This is not currently  | ||||
|                             managing the controller specified by  | ||||
|                             ControllerHandle and ChildHandle. | ||||
|     EFI_UNSUPPORTED       - The driver specified by This does not support the  | ||||
|                             language specified by Language. | ||||
|  | ||||
| --*/ | ||||
| { | ||||
|   EFI_STATUS              Status; | ||||
|   EFI_SERIAL_IO_PROTOCOL  *SerialIo; | ||||
| @@ -177,11 +218,12 @@ IsaSerialComponentNameGetControllerName ( | ||||
|   // | ||||
|   SerialDevice = SERIAL_DEV_FROM_THIS (SerialIo); | ||||
|  | ||||
|   return LookupUnicodeString ( | ||||
|   return LookupUnicodeString2 ( | ||||
|            Language, | ||||
|            gIsaSerialComponentName.SupportedLanguages, | ||||
|            This->SupportedLanguages, | ||||
|            SerialDevice->ControllerNameTable, | ||||
|            ControllerName | ||||
|            ControllerName, | ||||
|            (BOOLEAN)(This == &gIsaSerialComponentName) | ||||
|            ); | ||||
| } | ||||
|  | ||||
| @@ -211,10 +253,19 @@ AddName ( | ||||
|  | ||||
|   StrCpy (SerialPortName, L"ISA Serial Port # "); | ||||
|   SerialPortName[sizeof (SERIAL_PORT_NAME) - 2] = (CHAR16) (L'0' + (UINT8) IsaIo->ResourceList->Device.UID); | ||||
|   AddUnicodeString ( | ||||
|   AddUnicodeString2 ( | ||||
|     "eng", | ||||
|     gIsaSerialComponentName.SupportedLanguages, | ||||
|     &SerialDevice->ControllerNameTable, | ||||
|     (CHAR16 *) SerialPortName | ||||
|     (CHAR16 *) SerialPortName, | ||||
|     TRUE | ||||
|     ); | ||||
|   AddUnicodeString2 ( | ||||
|     "en", | ||||
|     gIsaSerialComponentName2.SupportedLanguages, | ||||
|     &SerialDevice->ControllerNameTable, | ||||
|     (CHAR16 *) SerialPortName, | ||||
|     FALSE | ||||
|     ); | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -19,48 +19,127 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. | ||||
| #define ADD_SERIAL_NAME(x, y)    AddName ((x), (y)) | ||||
|  | ||||
| extern EFI_COMPONENT_NAME_PROTOCOL   gIsaSerialComponentName; | ||||
| extern EFI_COMPONENT_NAME2_PROTOCOL  gIsaSerialComponentName2; | ||||
|  | ||||
| // | ||||
| // EFI Component Name Functions | ||||
| // | ||||
| /** | ||||
|   Retrieves a Unicode string that is the user readable name of the driver. | ||||
|  | ||||
|   This function retrieves the user readable name of a driver in the form of a | ||||
|   Unicode string. If the driver specified by This has a user readable name in | ||||
|   the language specified by Language, then a pointer to the driver name is | ||||
|   returned in DriverName, and EFI_SUCCESS is returned. If the driver specified | ||||
|   by This does not support the language specified by Language, | ||||
|   then EFI_UNSUPPORTED is returned. | ||||
|  | ||||
|   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | ||||
|                                 EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|  | ||||
|   @param  Language[in]          A pointer to a Null-terminated ASCII string | ||||
|                                 array indicating the language. This is the | ||||
|                                 language of the driver name that the caller is | ||||
|                                 requesting, and it must match one of the | ||||
|                                 languages specified in SupportedLanguages. The | ||||
|                                 number of languages supported by a driver is up | ||||
|                                 to the driver writer. Language is specified | ||||
|                                 in RFC 3066 or ISO 639-2 language code format. | ||||
|  | ||||
|   @param  DriverName[out]       A pointer to the Unicode string to return. | ||||
|                                 This Unicode string is the name of the | ||||
|                                 driver specified by This in the language | ||||
|                                 specified by Language. | ||||
|  | ||||
|   @retval EFI_SUCCESS           The Unicode string for the Driver specified by | ||||
|                                 This and the language specified by Language was | ||||
|                                 returned in DriverName. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER Language is NULL. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER DriverName is NULL. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This does not support | ||||
|                                 the language specified by Language. | ||||
|  | ||||
| **/ | ||||
| EFI_STATUS | ||||
| EFIAPI | ||||
| IsaSerialComponentNameGetDriverName ( | ||||
|   IN  EFI_COMPONENT_NAME_PROTOCOL  *This, | ||||
|   IN  CHAR8                        *Language, | ||||
|   OUT CHAR16                       **DriverName | ||||
|   ) | ||||
| /*++ | ||||
|   ); | ||||
|  | ||||
|   Routine Description: | ||||
|  | ||||
|     Retrieves a Unicode string that is the user readable name of the EFI Driver. | ||||
| /** | ||||
|   Retrieves a Unicode string that is the user readable name of the controller | ||||
|   that is being managed by a driver. | ||||
|  | ||||
|   Arguments: | ||||
|   This function retrieves the user readable name of the controller specified by | ||||
|   ControllerHandle and ChildHandle in the form of a Unicode string. If the | ||||
|   driver specified by This has a user readable name in the language specified by | ||||
|   Language, then a pointer to the controller name is returned in ControllerName, | ||||
|   and EFI_SUCCESS is returned.  If the driver specified by This is not currently | ||||
|   managing the controller specified by ControllerHandle and ChildHandle, | ||||
|   then EFI_UNSUPPORTED is returned.  If the driver specified by This does not | ||||
|   support the language specified by Language, then EFI_UNSUPPORTED is returned. | ||||
|  | ||||
|     This       - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|     Language   - A pointer to a three character ISO 639-2 language identifier. | ||||
|                  This is the language of the driver name that that the caller | ||||
|                  is requesting, and it must match one of the languages specified | ||||
|                  in SupportedLanguages.  The number of languages supported by a | ||||
|                  driver is up to the driver writer. | ||||
|     DriverName - A pointer to the Unicode string to return.  This Unicode string | ||||
|                  is the name of the driver specified by This in the language | ||||
|                  specified by Language. | ||||
|   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | ||||
|                                 EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|  | ||||
|   Returns: | ||||
|   @param  ControllerHandle[in]  The handle of a controller that the driver | ||||
|                                 specified by This is managing.  This handle | ||||
|                                 specifies the controller whose name is to be | ||||
|                                 returned. | ||||
|  | ||||
|     EFI_SUCCESS           - The Unicode string for the Driver specified by This | ||||
|                             and the language specified by Language was returned | ||||
|                             in DriverName. | ||||
|     EFI_INVALID_PARAMETER - Language is NULL. | ||||
|     EFI_INVALID_PARAMETER - DriverName is NULL. | ||||
|     EFI_UNSUPPORTED       - The driver specified by This does not support the | ||||
|                             language specified by Language. | ||||
|   @param  ChildHandle[in]       The handle of the child controller to retrieve | ||||
|                                 the name of.  This is an optional parameter that | ||||
|                                 may be NULL.  It will be NULL for device | ||||
|                                 drivers.  It will also be NULL for a bus drivers | ||||
|                                 that wish to retrieve the name of the bus | ||||
|                                 controller.  It will not be NULL for a bus | ||||
|                                 driver that wishes to retrieve the name of a | ||||
|                                 child controller. | ||||
|  | ||||
| --*/ | ||||
| ; | ||||
|   @param  Language[in]          A pointer to a Null-terminated ASCII string | ||||
|                                 array indicating the language.  This is the | ||||
|                                 language of the driver name that the caller is | ||||
|                                 requesting, and it must match one of the | ||||
|                                 languages specified in SupportedLanguages. The | ||||
|                                 number of languages supported by a driver is up | ||||
|                                 to the driver writer. Language is specified in | ||||
|                                 RFC 3066 or ISO 639-2 language code format. | ||||
|  | ||||
|   @param  ControllerName[out]   A pointer to the Unicode string to return. | ||||
|                                 This Unicode string is the name of the | ||||
|                                 controller specified by ControllerHandle and | ||||
|                                 ChildHandle in the language specified by | ||||
|                                 Language from the point of view of the driver | ||||
|                                 specified by This. | ||||
|  | ||||
|   @retval EFI_SUCCESS           The Unicode string for the user readable name in | ||||
|                                 the language specified by Language for the | ||||
|                                 driver specified by This was returned in | ||||
|                                 DriverName. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid | ||||
|                                 EFI_HANDLE. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER Language is NULL. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ControllerName is NULL. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This is not currently | ||||
|                                 managing the controller specified by | ||||
|                                 ControllerHandle and ChildHandle. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This does not support | ||||
|                                 the language specified by Language. | ||||
|  | ||||
| **/ | ||||
| EFI_STATUS | ||||
| EFIAPI | ||||
| IsaSerialComponentNameGetControllerName ( | ||||
| @@ -69,56 +148,8 @@ IsaSerialComponentNameGetControllerName ( | ||||
|   IN  EFI_HANDLE                                      ChildHandle        OPTIONAL, | ||||
|   IN  CHAR8                                           *Language, | ||||
|   OUT CHAR16                                          **ControllerName | ||||
|   ) | ||||
| /*++ | ||||
|   ); | ||||
|  | ||||
|   Routine Description: | ||||
|  | ||||
|     Retrieves a Unicode string that is the user readable name of the controller | ||||
|     that is being managed by an EFI Driver. | ||||
|  | ||||
|   Arguments: | ||||
|  | ||||
|     This             - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|     ControllerHandle - The handle of a controller that the driver specified by | ||||
|                        This is managing.  This handle specifies the controller | ||||
|                        whose name is to be returned. | ||||
|     ChildHandle      - The handle of the child controller to retrieve the name | ||||
|                        of.  This is an optional parameter that may be NULL.  It | ||||
|                        will be NULL for device drivers.  It will also be NULL | ||||
|                        for a bus drivers that wish to retrieve the name of the | ||||
|                        bus controller.  It will not be NULL for a bus driver | ||||
|                        that wishes to retrieve the name of a child controller. | ||||
|     Language         - A pointer to a three character ISO 639-2 language | ||||
|                        identifier.  This is the language of the controller name | ||||
|                        that that the caller is requesting, and it must match one | ||||
|                        of the languages specified in SupportedLanguages.  The | ||||
|                        number of languages supported by a driver is up to the | ||||
|                        driver writer. | ||||
|     ControllerName   - A pointer to the Unicode string to return.  This Unicode | ||||
|                        string is the name of the controller specified by | ||||
|                        ControllerHandle and ChildHandle in the language | ||||
|                        specified by Language from the point of view of the | ||||
|                        driver specified by This. | ||||
|  | ||||
|   Returns: | ||||
|  | ||||
|     EFI_SUCCESS           - The Unicode string for the user readable name in the | ||||
|                             language specified by Language for the driver | ||||
|                             specified by This was returned in DriverName. | ||||
|     EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE. | ||||
|     EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid | ||||
|                             EFI_HANDLE. | ||||
|     EFI_INVALID_PARAMETER - Language is NULL. | ||||
|     EFI_INVALID_PARAMETER - ControllerName is NULL. | ||||
|     EFI_UNSUPPORTED       - The driver specified by This is not currently | ||||
|                             managing the controller specified by | ||||
|                             ControllerHandle and ChildHandle. | ||||
|     EFI_UNSUPPORTED       - The driver specified by This does not support the | ||||
|                             language specified by Language. | ||||
|  | ||||
| --*/ | ||||
| ; | ||||
|  | ||||
| VOID | ||||
| AddName ( | ||||
|   | ||||
| @@ -108,14 +108,13 @@ InitializeIsaSerial ( | ||||
|   // | ||||
|   // Install driver model protocol(s). | ||||
|   // | ||||
|   Status = EfiLibInstallAllDriverProtocols ( | ||||
|   Status = EfiLibInstallDriverBindingComponentName2 ( | ||||
|              ImageHandle, | ||||
|              SystemTable, | ||||
|              &gSerialControllerDriver, | ||||
|              ImageHandle, | ||||
|              &gIsaSerialComponentName, | ||||
|              NULL, | ||||
|              NULL | ||||
|              &gIsaSerialComponentName2 | ||||
|              ); | ||||
|   ASSERT_EFI_ERROR (Status); | ||||
|  | ||||
|   | ||||
| @@ -38,6 +38,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. | ||||
| // | ||||
| extern EFI_DRIVER_BINDING_PROTOCOL  gSerialControllerDriver; | ||||
| extern EFI_COMPONENT_NAME_PROTOCOL  gIsaSerialComponentName; | ||||
| extern EFI_COMPONENT_NAME2_PROTOCOL gIsaSerialComponentName2; | ||||
|  | ||||
| // | ||||
| // Internal Data Structures | ||||
|   | ||||
| @@ -16,6 +16,45 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. | ||||
| // | ||||
| // EFI Component Name Functions | ||||
| // | ||||
| /** | ||||
|   Retrieves a Unicode string that is the user readable name of the driver. | ||||
|  | ||||
|   This function retrieves the user readable name of a driver in the form of a | ||||
|   Unicode string. If the driver specified by This has a user readable name in | ||||
|   the language specified by Language, then a pointer to the driver name is | ||||
|   returned in DriverName, and EFI_SUCCESS is returned. If the driver specified | ||||
|   by This does not support the language specified by Language, | ||||
|   then EFI_UNSUPPORTED is returned. | ||||
|  | ||||
|   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | ||||
|                                 EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|  | ||||
|   @param  Language[in]          A pointer to a Null-terminated ASCII string | ||||
|                                 array indicating the language. This is the | ||||
|                                 language of the driver name that the caller is | ||||
|                                 requesting, and it must match one of the | ||||
|                                 languages specified in SupportedLanguages. The | ||||
|                                 number of languages supported by a driver is up | ||||
|                                 to the driver writer. Language is specified | ||||
|                                 in RFC 3066 or ISO 639-2 language code format. | ||||
|  | ||||
|   @param  DriverName[out]       A pointer to the Unicode string to return. | ||||
|                                 This Unicode string is the name of the | ||||
|                                 driver specified by This in the language | ||||
|                                 specified by Language. | ||||
|  | ||||
|   @retval EFI_SUCCESS           The Unicode string for the Driver specified by | ||||
|                                 This and the language specified by Language was | ||||
|                                 returned in DriverName. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER Language is NULL. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER DriverName is NULL. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This does not support | ||||
|                                 the language specified by Language. | ||||
|  | ||||
| **/ | ||||
| EFI_STATUS | ||||
| EFIAPI | ||||
| Ps2KeyboardComponentNameGetDriverName ( | ||||
| @@ -24,6 +63,75 @@ Ps2KeyboardComponentNameGetDriverName ( | ||||
|   OUT CHAR16                       **DriverName | ||||
|   ); | ||||
|  | ||||
|  | ||||
| /** | ||||
|   Retrieves a Unicode string that is the user readable name of the controller | ||||
|   that is being managed by a driver. | ||||
|  | ||||
|   This function retrieves the user readable name of the controller specified by | ||||
|   ControllerHandle and ChildHandle in the form of a Unicode string. If the | ||||
|   driver specified by This has a user readable name in the language specified by | ||||
|   Language, then a pointer to the controller name is returned in ControllerName, | ||||
|   and EFI_SUCCESS is returned.  If the driver specified by This is not currently | ||||
|   managing the controller specified by ControllerHandle and ChildHandle, | ||||
|   then EFI_UNSUPPORTED is returned.  If the driver specified by This does not | ||||
|   support the language specified by Language, then EFI_UNSUPPORTED is returned. | ||||
|  | ||||
|   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | ||||
|                                 EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|  | ||||
|   @param  ControllerHandle[in]  The handle of a controller that the driver | ||||
|                                 specified by This is managing.  This handle | ||||
|                                 specifies the controller whose name is to be | ||||
|                                 returned. | ||||
|  | ||||
|   @param  ChildHandle[in]       The handle of the child controller to retrieve | ||||
|                                 the name of.  This is an optional parameter that | ||||
|                                 may be NULL.  It will be NULL for device | ||||
|                                 drivers.  It will also be NULL for a bus drivers | ||||
|                                 that wish to retrieve the name of the bus | ||||
|                                 controller.  It will not be NULL for a bus | ||||
|                                 driver that wishes to retrieve the name of a | ||||
|                                 child controller. | ||||
|  | ||||
|   @param  Language[in]          A pointer to a Null-terminated ASCII string | ||||
|                                 array indicating the language.  This is the | ||||
|                                 language of the driver name that the caller is | ||||
|                                 requesting, and it must match one of the | ||||
|                                 languages specified in SupportedLanguages. The | ||||
|                                 number of languages supported by a driver is up | ||||
|                                 to the driver writer. Language is specified in | ||||
|                                 RFC 3066 or ISO 639-2 language code format. | ||||
|  | ||||
|   @param  ControllerName[out]   A pointer to the Unicode string to return. | ||||
|                                 This Unicode string is the name of the | ||||
|                                 controller specified by ControllerHandle and | ||||
|                                 ChildHandle in the language specified by | ||||
|                                 Language from the point of view of the driver | ||||
|                                 specified by This. | ||||
|  | ||||
|   @retval EFI_SUCCESS           The Unicode string for the user readable name in | ||||
|                                 the language specified by Language for the | ||||
|                                 driver specified by This was returned in | ||||
|                                 DriverName. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid | ||||
|                                 EFI_HANDLE. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER Language is NULL. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ControllerName is NULL. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This is not currently | ||||
|                                 managing the controller specified by | ||||
|                                 ControllerHandle and ChildHandle. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This does not support | ||||
|                                 the language specified by Language. | ||||
|  | ||||
| **/ | ||||
| EFI_STATUS | ||||
| EFIAPI | ||||
| Ps2KeyboardComponentNameGetControllerName ( | ||||
| @@ -34,6 +142,7 @@ Ps2KeyboardComponentNameGetControllerName ( | ||||
|   OUT CHAR16                                          **ControllerName | ||||
|   ); | ||||
|  | ||||
|  | ||||
| // | ||||
| // EFI Component Name Protocol | ||||
| // | ||||
| @@ -43,9 +152,19 @@ EFI_COMPONENT_NAME_PROTOCOL     gPs2KeyboardComponentName = { | ||||
|   "eng" | ||||
|   }; | ||||
|  | ||||
| // | ||||
| // EFI Component Name 2 Protocol | ||||
| // | ||||
| EFI_COMPONENT_NAME2_PROTOCOL gPs2KeyboardComponentName2 = { | ||||
|   (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) Ps2KeyboardComponentNameGetDriverName, | ||||
|   (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) Ps2KeyboardComponentNameGetControllerName, | ||||
|   "en" | ||||
|   }; | ||||
|  | ||||
|  | ||||
| static EFI_UNICODE_STRING_TABLE mPs2KeyboardDriverNameTable[] = { | ||||
|   { | ||||
|     "eng", | ||||
|     "eng;en", | ||||
|     L"PS/2 Keyboard Driver" | ||||
|   }, | ||||
|   { | ||||
| @@ -54,6 +173,45 @@ static EFI_UNICODE_STRING_TABLE mPs2KeyboardDriverNameTable[] = { | ||||
|   } | ||||
| }; | ||||
|  | ||||
| /** | ||||
|   Retrieves a Unicode string that is the user readable name of the driver. | ||||
|  | ||||
|   This function retrieves the user readable name of a driver in the form of a | ||||
|   Unicode string. If the driver specified by This has a user readable name in | ||||
|   the language specified by Language, then a pointer to the driver name is | ||||
|   returned in DriverName, and EFI_SUCCESS is returned. If the driver specified | ||||
|   by This does not support the language specified by Language, | ||||
|   then EFI_UNSUPPORTED is returned. | ||||
|  | ||||
|   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | ||||
|                                 EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|  | ||||
|   @param  Language[in]          A pointer to a Null-terminated ASCII string | ||||
|                                 array indicating the language. This is the | ||||
|                                 language of the driver name that the caller is | ||||
|                                 requesting, and it must match one of the | ||||
|                                 languages specified in SupportedLanguages. The | ||||
|                                 number of languages supported by a driver is up | ||||
|                                 to the driver writer. Language is specified | ||||
|                                 in RFC 3066 or ISO 639-2 language code format. | ||||
|  | ||||
|   @param  DriverName[out]       A pointer to the Unicode string to return. | ||||
|                                 This Unicode string is the name of the | ||||
|                                 driver specified by This in the language | ||||
|                                 specified by Language. | ||||
|  | ||||
|   @retval EFI_SUCCESS           The Unicode string for the Driver specified by | ||||
|                                 This and the language specified by Language was | ||||
|                                 returned in DriverName. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER Language is NULL. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER DriverName is NULL. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This does not support | ||||
|                                 the language specified by Language. | ||||
|  | ||||
| **/ | ||||
| EFI_STATUS | ||||
| EFIAPI | ||||
| Ps2KeyboardComponentNameGetDriverName ( | ||||
| @@ -61,44 +219,84 @@ Ps2KeyboardComponentNameGetDriverName ( | ||||
|   IN  CHAR8                        *Language, | ||||
|   OUT CHAR16                       **DriverName | ||||
|   ) | ||||
| /*++ | ||||
|  | ||||
|   Routine Description: | ||||
|  | ||||
|     Retrieves a Unicode string that is the user readable name of the EFI Driver. | ||||
|  | ||||
|   Arguments: | ||||
|  | ||||
|     This       - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|     Language   - A pointer to a three character ISO 639-2 language identifier. | ||||
|                  This is the language of the driver name that that the caller | ||||
|                  is requesting, and it must match one of the languages specified | ||||
|                  in SupportedLanguages.  The number of languages supported by a | ||||
|                  driver is up to the driver writer. | ||||
|     DriverName - A pointer to the Unicode string to return.  This Unicode string | ||||
|                  is the name of the driver specified by This in the language | ||||
|                  specified by Language. | ||||
|  | ||||
|   Returns: | ||||
|  | ||||
|     EFI_SUCCESS           - The Unicode string for the Driver specified by This | ||||
|                             and the language specified by Language was returned | ||||
|                             in DriverName. | ||||
|     EFI_INVALID_PARAMETER - Language is NULL. | ||||
|     EFI_INVALID_PARAMETER - DriverName is NULL. | ||||
|     EFI_UNSUPPORTED       - The driver specified by This does not support the | ||||
|                             language specified by Language. | ||||
|  | ||||
| --*/ | ||||
| { | ||||
|   return LookupUnicodeString ( | ||||
|   return LookupUnicodeString2 ( | ||||
|            Language, | ||||
|            gPs2KeyboardComponentName.SupportedLanguages, | ||||
|            This->SupportedLanguages, | ||||
|            mPs2KeyboardDriverNameTable, | ||||
|            DriverName | ||||
|            DriverName, | ||||
|            (BOOLEAN)(This == &gPs2KeyboardComponentName) | ||||
|            ); | ||||
| } | ||||
|  | ||||
| /** | ||||
|   Retrieves a Unicode string that is the user readable name of the controller | ||||
|   that is being managed by a driver. | ||||
|  | ||||
|   This function retrieves the user readable name of the controller specified by | ||||
|   ControllerHandle and ChildHandle in the form of a Unicode string. If the | ||||
|   driver specified by This has a user readable name in the language specified by | ||||
|   Language, then a pointer to the controller name is returned in ControllerName, | ||||
|   and EFI_SUCCESS is returned.  If the driver specified by This is not currently | ||||
|   managing the controller specified by ControllerHandle and ChildHandle, | ||||
|   then EFI_UNSUPPORTED is returned.  If the driver specified by This does not | ||||
|   support the language specified by Language, then EFI_UNSUPPORTED is returned. | ||||
|  | ||||
|   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | ||||
|                                 EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|  | ||||
|   @param  ControllerHandle[in]  The handle of a controller that the driver | ||||
|                                 specified by This is managing.  This handle | ||||
|                                 specifies the controller whose name is to be | ||||
|                                 returned. | ||||
|  | ||||
|   @param  ChildHandle[in]       The handle of the child controller to retrieve | ||||
|                                 the name of.  This is an optional parameter that | ||||
|                                 may be NULL.  It will be NULL for device | ||||
|                                 drivers.  It will also be NULL for a bus drivers | ||||
|                                 that wish to retrieve the name of the bus | ||||
|                                 controller.  It will not be NULL for a bus | ||||
|                                 driver that wishes to retrieve the name of a | ||||
|                                 child controller. | ||||
|  | ||||
|   @param  Language[in]          A pointer to a Null-terminated ASCII string | ||||
|                                 array indicating the language.  This is the | ||||
|                                 language of the driver name that the caller is | ||||
|                                 requesting, and it must match one of the | ||||
|                                 languages specified in SupportedLanguages. The | ||||
|                                 number of languages supported by a driver is up | ||||
|                                 to the driver writer. Language is specified in | ||||
|                                 RFC 3066 or ISO 639-2 language code format. | ||||
|  | ||||
|   @param  ControllerName[out]   A pointer to the Unicode string to return. | ||||
|                                 This Unicode string is the name of the | ||||
|                                 controller specified by ControllerHandle and | ||||
|                                 ChildHandle in the language specified by | ||||
|                                 Language from the point of view of the driver | ||||
|                                 specified by This. | ||||
|  | ||||
|   @retval EFI_SUCCESS           The Unicode string for the user readable name in | ||||
|                                 the language specified by Language for the | ||||
|                                 driver specified by This was returned in | ||||
|                                 DriverName. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid | ||||
|                                 EFI_HANDLE. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER Language is NULL. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ControllerName is NULL. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This is not currently | ||||
|                                 managing the controller specified by | ||||
|                                 ControllerHandle and ChildHandle. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This does not support | ||||
|                                 the language specified by Language. | ||||
|  | ||||
| **/ | ||||
| EFI_STATUS | ||||
| EFIAPI | ||||
| Ps2KeyboardComponentNameGetControllerName ( | ||||
| @@ -108,53 +306,6 @@ Ps2KeyboardComponentNameGetControllerName ( | ||||
|   IN  CHAR8                                           *Language, | ||||
|   OUT CHAR16                                          **ControllerName | ||||
|   ) | ||||
| /*++ | ||||
|  | ||||
|   Routine Description: | ||||
|  | ||||
|     Retrieves a Unicode string that is the user readable name of the controller | ||||
|     that is being managed by an EFI Driver. | ||||
|  | ||||
|   Arguments: | ||||
|  | ||||
|     This             - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|     ControllerHandle - The handle of a controller that the driver specified by | ||||
|                        This is managing.  This handle specifies the controller | ||||
|                        whose name is to be returned. | ||||
|     ChildHandle      - The handle of the child controller to retrieve the name | ||||
|                        of.  This is an optional parameter that may be NULL.  It | ||||
|                        will be NULL for device drivers.  It will also be NULL | ||||
|                        for a bus drivers that wish to retrieve the name of the | ||||
|                        bus controller.  It will not be NULL for a bus driver | ||||
|                        that wishes to retrieve the name of a child controller. | ||||
|     Language         - A pointer to a three character ISO 639-2 language | ||||
|                        identifier.  This is the language of the controller name | ||||
|                        that that the caller is requesting, and it must match one | ||||
|                        of the languages specified in SupportedLanguages.  The | ||||
|                        number of languages supported by a driver is up to the | ||||
|                        driver writer. | ||||
|     ControllerName   - A pointer to the Unicode string to return.  This Unicode | ||||
|                        string is the name of the controller specified by | ||||
|                        ControllerHandle and ChildHandle in the language specified | ||||
|                        by Language from the point of view of the driver specified | ||||
|                        by This. | ||||
|  | ||||
|   Returns: | ||||
|  | ||||
|     EFI_SUCCESS           - The Unicode string for the user readable name in the | ||||
|                             language specified by Language for the driver | ||||
|                             specified by This was returned in DriverName. | ||||
|     EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE. | ||||
|     EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE. | ||||
|     EFI_INVALID_PARAMETER - Language is NULL. | ||||
|     EFI_INVALID_PARAMETER - ControllerName is NULL. | ||||
|     EFI_UNSUPPORTED       - The driver specified by This is not currently managing | ||||
|                             the controller specified by ControllerHandle and | ||||
|                             ChildHandle. | ||||
|     EFI_UNSUPPORTED       - The driver specified by This does not support the | ||||
|                             language specified by Language. | ||||
|  | ||||
| --*/ | ||||
| { | ||||
|   EFI_STATUS                                  Status; | ||||
|   EFI_SIMPLE_TEXT_INPUT_PROTOCOL              *ConIn; | ||||
| @@ -210,10 +361,11 @@ Ps2KeyboardComponentNameGetControllerName ( | ||||
|  | ||||
|   ConsoleIn = KEYBOARD_CONSOLE_IN_DEV_FROM_THIS (ConIn); | ||||
|  | ||||
|   return LookupUnicodeString ( | ||||
|   return LookupUnicodeString2 ( | ||||
|            Language, | ||||
|            gPs2KeyboardComponentName.SupportedLanguages, | ||||
|            This->SupportedLanguages, | ||||
|            ConsoleIn->ControllerNameTable, | ||||
|            ControllerName | ||||
|            ControllerName, | ||||
|            (BOOLEAN)(This == &gPs2KeyboardComponentName) | ||||
|            ); | ||||
| } | ||||
|   | ||||
| @@ -274,12 +274,21 @@ Returns: | ||||
|   } | ||||
|  | ||||
|   ConsoleIn->ControllerNameTable = NULL; | ||||
|   AddUnicodeString ( | ||||
|   AddUnicodeString2 ( | ||||
|     "eng", | ||||
|     gPs2KeyboardComponentName.SupportedLanguages, | ||||
|     &ConsoleIn->ControllerNameTable, | ||||
|     L"PS/2 Keyboard Device" | ||||
|     L"PS/2 Keyboard Device", | ||||
|     TRUE | ||||
|     ); | ||||
|   AddUnicodeString2 ( | ||||
|     "en", | ||||
|     gPs2KeyboardComponentName2.SupportedLanguages, | ||||
|     &ConsoleIn->ControllerNameTable, | ||||
|     L"PS/2 Keyboard Device", | ||||
|     FALSE | ||||
|     ); | ||||
|  | ||||
|  | ||||
|   // | ||||
|   // Install protocol interfaces for the keyboard device. | ||||
| @@ -484,14 +493,13 @@ InitializePs2Keyboard( | ||||
|   // | ||||
|   // Install driver model protocol(s). | ||||
|   // | ||||
|   Status = EfiLibInstallAllDriverProtocols ( | ||||
|   Status = EfiLibInstallDriverBindingComponentName2 ( | ||||
|              ImageHandle, | ||||
|              SystemTable, | ||||
|              &gKeyboardControllerDriver, | ||||
|              ImageHandle, | ||||
|              &gPs2KeyboardComponentName, | ||||
|              NULL, | ||||
|              NULL | ||||
|              &gPs2KeyboardComponentName2 | ||||
|              ); | ||||
|   ASSERT_EFI_ERROR (Status); | ||||
|  | ||||
|   | ||||
| @@ -92,6 +92,7 @@ typedef struct { | ||||
| // | ||||
| extern EFI_DRIVER_BINDING_PROTOCOL   gKeyboardControllerDriver; | ||||
| extern EFI_COMPONENT_NAME_PROTOCOL   gPs2KeyboardComponentName; | ||||
| extern EFI_COMPONENT_NAME2_PROTOCOL  gPs2KeyboardComponentName2; | ||||
|  | ||||
| // | ||||
| // Driver entry point | ||||
|   | ||||
| @@ -22,9 +22,19 @@ EFI_COMPONENT_NAME_PROTOCOL     gPs2MouseComponentName = { | ||||
|   "eng" | ||||
|   }; | ||||
|  | ||||
| // | ||||
| // EFI Component Name 2 Protocol | ||||
| // | ||||
| EFI_COMPONENT_NAME2_PROTOCOL gPs2MouseComponentName2 = { | ||||
|   (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) Ps2MouseComponentNameGetDriverName, | ||||
|   (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) Ps2MouseComponentNameGetControllerName, | ||||
|   "en" | ||||
|   }; | ||||
|  | ||||
|  | ||||
| static EFI_UNICODE_STRING_TABLE mPs2MouseDriverNameTable[] = { | ||||
|   { | ||||
|     "eng", | ||||
|     "eng;en", | ||||
|     L"PS/2 Mouse Driver" | ||||
|   }, | ||||
|   { | ||||
| @@ -33,6 +43,45 @@ static EFI_UNICODE_STRING_TABLE mPs2MouseDriverNameTable[] = { | ||||
|   } | ||||
| }; | ||||
|  | ||||
| /** | ||||
|   Retrieves a Unicode string that is the user readable name of the driver. | ||||
|  | ||||
|   This function retrieves the user readable name of a driver in the form of a | ||||
|   Unicode string. If the driver specified by This has a user readable name in | ||||
|   the language specified by Language, then a pointer to the driver name is | ||||
|   returned in DriverName, and EFI_SUCCESS is returned. If the driver specified | ||||
|   by This does not support the language specified by Language, | ||||
|   then EFI_UNSUPPORTED is returned. | ||||
|  | ||||
|   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | ||||
|                                 EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|  | ||||
|   @param  Language[in]          A pointer to a Null-terminated ASCII string | ||||
|                                 array indicating the language. This is the | ||||
|                                 language of the driver name that the caller is | ||||
|                                 requesting, and it must match one of the | ||||
|                                 languages specified in SupportedLanguages. The | ||||
|                                 number of languages supported by a driver is up | ||||
|                                 to the driver writer. Language is specified | ||||
|                                 in RFC 3066 or ISO 639-2 language code format. | ||||
|  | ||||
|   @param  DriverName[out]       A pointer to the Unicode string to return. | ||||
|                                 This Unicode string is the name of the | ||||
|                                 driver specified by This in the language | ||||
|                                 specified by Language. | ||||
|  | ||||
|   @retval EFI_SUCCESS           The Unicode string for the Driver specified by | ||||
|                                 This and the language specified by Language was | ||||
|                                 returned in DriverName. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER Language is NULL. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER DriverName is NULL. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This does not support | ||||
|                                 the language specified by Language. | ||||
|  | ||||
| **/ | ||||
| EFI_STATUS | ||||
| EFIAPI | ||||
| Ps2MouseComponentNameGetDriverName ( | ||||
| @@ -40,44 +89,84 @@ Ps2MouseComponentNameGetDriverName ( | ||||
|   IN  CHAR8                        *Language, | ||||
|   OUT CHAR16                       **DriverName | ||||
|   ) | ||||
| /*++ | ||||
|  | ||||
|   Routine Description: | ||||
|    | ||||
|     Retrieves a Unicode string that is the user readable name of the EFI Driver. | ||||
|  | ||||
|   Arguments: | ||||
|    | ||||
|     This       - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|     Language   - A pointer to a three character ISO 639-2 language identifier. | ||||
|                  This is the language of the driver name that that the caller  | ||||
|                  is requesting, and it must match one of the languages specified | ||||
|                  in SupportedLanguages.  The number of languages supported by a  | ||||
|                  driver is up to the driver writer. | ||||
|     DriverName - A pointer to the Unicode string to return.  This Unicode string | ||||
|                  is the name of the driver specified by This in the language  | ||||
|                  specified by Language. | ||||
|  | ||||
|   Returns: | ||||
|    | ||||
|     EFI_SUCCESS           - The Unicode string for the Driver specified by This | ||||
|                             and the language specified by Language was returned  | ||||
|                             in DriverName. | ||||
|     EFI_INVALID_PARAMETER - Language is NULL. | ||||
|     EFI_INVALID_PARAMETER - DriverName is NULL. | ||||
|     EFI_UNSUPPORTED       - The driver specified by This does not support the  | ||||
|                             language specified by Language. | ||||
|  | ||||
| --*/ | ||||
| { | ||||
|   return LookupUnicodeString ( | ||||
|   return LookupUnicodeString2 ( | ||||
|            Language, | ||||
|            gPs2MouseComponentName.SupportedLanguages, | ||||
|            This->SupportedLanguages, | ||||
|            mPs2MouseDriverNameTable, | ||||
|            DriverName | ||||
|            DriverName, | ||||
|            (BOOLEAN)(This == &gPs2MouseComponentName) | ||||
|            ); | ||||
| } | ||||
|  | ||||
| /** | ||||
|   Retrieves a Unicode string that is the user readable name of the controller | ||||
|   that is being managed by a driver. | ||||
|  | ||||
|   This function retrieves the user readable name of the controller specified by | ||||
|   ControllerHandle and ChildHandle in the form of a Unicode string. If the | ||||
|   driver specified by This has a user readable name in the language specified by | ||||
|   Language, then a pointer to the controller name is returned in ControllerName, | ||||
|   and EFI_SUCCESS is returned.  If the driver specified by This is not currently | ||||
|   managing the controller specified by ControllerHandle and ChildHandle, | ||||
|   then EFI_UNSUPPORTED is returned.  If the driver specified by This does not | ||||
|   support the language specified by Language, then EFI_UNSUPPORTED is returned. | ||||
|  | ||||
|   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | ||||
|                                 EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|  | ||||
|   @param  ControllerHandle[in]  The handle of a controller that the driver | ||||
|                                 specified by This is managing.  This handle | ||||
|                                 specifies the controller whose name is to be | ||||
|                                 returned. | ||||
|  | ||||
|   @param  ChildHandle[in]       The handle of the child controller to retrieve | ||||
|                                 the name of.  This is an optional parameter that | ||||
|                                 may be NULL.  It will be NULL for device | ||||
|                                 drivers.  It will also be NULL for a bus drivers | ||||
|                                 that wish to retrieve the name of the bus | ||||
|                                 controller.  It will not be NULL for a bus | ||||
|                                 driver that wishes to retrieve the name of a | ||||
|                                 child controller. | ||||
|  | ||||
|   @param  Language[in]          A pointer to a Null-terminated ASCII string | ||||
|                                 array indicating the language.  This is the | ||||
|                                 language of the driver name that the caller is | ||||
|                                 requesting, and it must match one of the | ||||
|                                 languages specified in SupportedLanguages. The | ||||
|                                 number of languages supported by a driver is up | ||||
|                                 to the driver writer. Language is specified in | ||||
|                                 RFC 3066 or ISO 639-2 language code format. | ||||
|  | ||||
|   @param  ControllerName[out]   A pointer to the Unicode string to return. | ||||
|                                 This Unicode string is the name of the | ||||
|                                 controller specified by ControllerHandle and | ||||
|                                 ChildHandle in the language specified by | ||||
|                                 Language from the point of view of the driver | ||||
|                                 specified by This. | ||||
|  | ||||
|   @retval EFI_SUCCESS           The Unicode string for the user readable name in | ||||
|                                 the language specified by Language for the | ||||
|                                 driver specified by This was returned in | ||||
|                                 DriverName. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid | ||||
|                                 EFI_HANDLE. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER Language is NULL. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ControllerName is NULL. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This is not currently | ||||
|                                 managing the controller specified by | ||||
|                                 ControllerHandle and ChildHandle. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This does not support | ||||
|                                 the language specified by Language. | ||||
|  | ||||
| **/ | ||||
| EFI_STATUS | ||||
| EFIAPI | ||||
| Ps2MouseComponentNameGetControllerName ( | ||||
| @@ -87,53 +176,6 @@ Ps2MouseComponentNameGetControllerName ( | ||||
|   IN  CHAR8                                           *Language, | ||||
|   OUT CHAR16                                          **ControllerName | ||||
|   ) | ||||
| /*++ | ||||
|  | ||||
|   Routine Description: | ||||
|    | ||||
|     Retrieves a Unicode string that is the user readable name of the controller | ||||
|     that is being managed by an EFI Driver. | ||||
|  | ||||
|   Arguments: | ||||
|    | ||||
|     This             - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|     ControllerHandle - The handle of a controller that the driver specified by  | ||||
|                        This is managing.  This handle specifies the controller  | ||||
|                        whose name is to be returned. | ||||
|     ChildHandle      - The handle of the child controller to retrieve the name  | ||||
|                        of.  This is an optional parameter that may be NULL.  It  | ||||
|                        will be NULL for device drivers.  It will also be NULL  | ||||
|                        for a bus drivers that wish to retrieve the name of the  | ||||
|                        bus controller.  It will not be NULL for a bus driver  | ||||
|                        that wishes to retrieve the name of a child controller. | ||||
|     Language         - A pointer to a three character ISO 639-2 language  | ||||
|                        identifier.  This is the language of the controller name  | ||||
|                        that that the caller is requesting, and it must match one | ||||
|                        of the languages specified in SupportedLanguages.  The  | ||||
|                        number of languages supported by a driver is up to the  | ||||
|                        driver writer. | ||||
|     ControllerName   - A pointer to the Unicode string to return.  This Unicode | ||||
|                        string is the name of the controller specified by  | ||||
|                        ControllerHandle and ChildHandle in the language specified | ||||
|                        by Language from the point of view of the driver specified | ||||
|                        by This.  | ||||
|  | ||||
|   Returns: | ||||
|    | ||||
|     EFI_SUCCESS           - The Unicode string for the user readable name in the  | ||||
|                             language specified by Language for the driver  | ||||
|                             specified by This was returned in DriverName. | ||||
|     EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE. | ||||
|     EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE. | ||||
|     EFI_INVALID_PARAMETER - Language is NULL. | ||||
|     EFI_INVALID_PARAMETER - ControllerName is NULL. | ||||
|     EFI_UNSUPPORTED       - The driver specified by This is not currently managing  | ||||
|                             the controller specified by ControllerHandle and  | ||||
|                             ChildHandle. | ||||
|     EFI_UNSUPPORTED       - The driver specified by This does not support the  | ||||
|                             language specified by Language. | ||||
|  | ||||
| --*/ | ||||
| { | ||||
|   EFI_STATUS                                  Status; | ||||
|   EFI_SIMPLE_POINTER_PROTOCOL                 *SimplePointerProtocol; | ||||
| @@ -188,10 +230,11 @@ Ps2MouseComponentNameGetControllerName ( | ||||
|  | ||||
|   MouseDev = PS2_MOUSE_DEV_FROM_THIS (SimplePointerProtocol); | ||||
|  | ||||
|   return LookupUnicodeString ( | ||||
|   return LookupUnicodeString2 ( | ||||
|            Language, | ||||
|            gPs2MouseComponentName.SupportedLanguages, | ||||
|            This->SupportedLanguages, | ||||
|            MouseDev->ControllerNameTable, | ||||
|            ControllerName | ||||
|            ControllerName, | ||||
|            (BOOLEAN)(This == &gPs2MouseComponentName) | ||||
|            ); | ||||
| } | ||||
|   | ||||
| @@ -294,12 +294,21 @@ Returns: | ||||
|   } | ||||
|  | ||||
|   MouseDev->ControllerNameTable = NULL; | ||||
|   AddUnicodeString ( | ||||
|   AddUnicodeString2 ( | ||||
|     "eng", | ||||
|     gPs2MouseComponentName.SupportedLanguages, | ||||
|     &MouseDev->ControllerNameTable, | ||||
|     L"PS/2 Mouse Device" | ||||
|     L"PS/2 Mouse Device", | ||||
|     TRUE | ||||
|     ); | ||||
|   AddUnicodeString2 ( | ||||
|     "en", | ||||
|     gPs2MouseComponentName2.SupportedLanguages, | ||||
|     &MouseDev->ControllerNameTable, | ||||
|     L"PS/2 Mouse Device", | ||||
|     FALSE | ||||
|     ); | ||||
|  | ||||
|  | ||||
|   // | ||||
|   // Install protocol interfaces for the mouse device. | ||||
| @@ -771,14 +780,13 @@ InitializePs2Mouse( | ||||
|   // | ||||
|   // Install driver model protocol(s). | ||||
|   // | ||||
|   Status = EfiLibInstallAllDriverProtocols ( | ||||
|   Status = EfiLibInstallDriverBindingComponentName2 ( | ||||
|              ImageHandle, | ||||
|              SystemTable, | ||||
|              &gPS2MouseDriver, | ||||
|              ImageHandle, | ||||
|              &gPs2MouseComponentName, | ||||
|              NULL, | ||||
|              NULL | ||||
|              &gPs2MouseComponentName2 | ||||
|              ); | ||||
|   ASSERT_EFI_ERROR (Status); | ||||
|  | ||||
|   | ||||
| @@ -100,6 +100,7 @@ typedef struct { | ||||
| // | ||||
| extern EFI_DRIVER_BINDING_PROTOCOL   gPS2MouseDriver; | ||||
| extern EFI_COMPONENT_NAME_PROTOCOL   gPs2MouseComponentName; | ||||
| extern EFI_COMPONENT_NAME2_PROTOCOL  gPs2MouseComponentName2; | ||||
|  | ||||
| // | ||||
| // Function prototypes | ||||
| @@ -132,6 +133,45 @@ PS2MouseDriverStop ( | ||||
| // | ||||
| // EFI Component Name Functions | ||||
| // | ||||
| /** | ||||
|   Retrieves a Unicode string that is the user readable name of the driver. | ||||
|  | ||||
|   This function retrieves the user readable name of a driver in the form of a | ||||
|   Unicode string. If the driver specified by This has a user readable name in | ||||
|   the language specified by Language, then a pointer to the driver name is | ||||
|   returned in DriverName, and EFI_SUCCESS is returned. If the driver specified | ||||
|   by This does not support the language specified by Language, | ||||
|   then EFI_UNSUPPORTED is returned. | ||||
|  | ||||
|   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | ||||
|                                 EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|  | ||||
|   @param  Language[in]          A pointer to a Null-terminated ASCII string | ||||
|                                 array indicating the language. This is the | ||||
|                                 language of the driver name that the caller is | ||||
|                                 requesting, and it must match one of the | ||||
|                                 languages specified in SupportedLanguages. The | ||||
|                                 number of languages supported by a driver is up | ||||
|                                 to the driver writer. Language is specified | ||||
|                                 in RFC 3066 or ISO 639-2 language code format. | ||||
|  | ||||
|   @param  DriverName[out]       A pointer to the Unicode string to return. | ||||
|                                 This Unicode string is the name of the | ||||
|                                 driver specified by This in the language | ||||
|                                 specified by Language. | ||||
|  | ||||
|   @retval EFI_SUCCESS           The Unicode string for the Driver specified by | ||||
|                                 This and the language specified by Language was | ||||
|                                 returned in DriverName. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER Language is NULL. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER DriverName is NULL. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This does not support | ||||
|                                 the language specified by Language. | ||||
|  | ||||
| **/ | ||||
| EFI_STATUS | ||||
| EFIAPI | ||||
| Ps2MouseComponentNameGetDriverName ( | ||||
| @@ -140,6 +180,75 @@ Ps2MouseComponentNameGetDriverName ( | ||||
|   OUT CHAR16                       **DriverName | ||||
|   ); | ||||
|  | ||||
|  | ||||
| /** | ||||
|   Retrieves a Unicode string that is the user readable name of the controller | ||||
|   that is being managed by a driver. | ||||
|  | ||||
|   This function retrieves the user readable name of the controller specified by | ||||
|   ControllerHandle and ChildHandle in the form of a Unicode string. If the | ||||
|   driver specified by This has a user readable name in the language specified by | ||||
|   Language, then a pointer to the controller name is returned in ControllerName, | ||||
|   and EFI_SUCCESS is returned.  If the driver specified by This is not currently | ||||
|   managing the controller specified by ControllerHandle and ChildHandle, | ||||
|   then EFI_UNSUPPORTED is returned.  If the driver specified by This does not | ||||
|   support the language specified by Language, then EFI_UNSUPPORTED is returned. | ||||
|  | ||||
|   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | ||||
|                                 EFI_COMPONENT_NAME_PROTOCOL instance. | ||||
|  | ||||
|   @param  ControllerHandle[in]  The handle of a controller that the driver | ||||
|                                 specified by This is managing.  This handle | ||||
|                                 specifies the controller whose name is to be | ||||
|                                 returned. | ||||
|  | ||||
|   @param  ChildHandle[in]       The handle of the child controller to retrieve | ||||
|                                 the name of.  This is an optional parameter that | ||||
|                                 may be NULL.  It will be NULL for device | ||||
|                                 drivers.  It will also be NULL for a bus drivers | ||||
|                                 that wish to retrieve the name of the bus | ||||
|                                 controller.  It will not be NULL for a bus | ||||
|                                 driver that wishes to retrieve the name of a | ||||
|                                 child controller. | ||||
|  | ||||
|   @param  Language[in]          A pointer to a Null-terminated ASCII string | ||||
|                                 array indicating the language.  This is the | ||||
|                                 language of the driver name that the caller is | ||||
|                                 requesting, and it must match one of the | ||||
|                                 languages specified in SupportedLanguages. The | ||||
|                                 number of languages supported by a driver is up | ||||
|                                 to the driver writer. Language is specified in | ||||
|                                 RFC 3066 or ISO 639-2 language code format. | ||||
|  | ||||
|   @param  ControllerName[out]   A pointer to the Unicode string to return. | ||||
|                                 This Unicode string is the name of the | ||||
|                                 controller specified by ControllerHandle and | ||||
|                                 ChildHandle in the language specified by | ||||
|                                 Language from the point of view of the driver | ||||
|                                 specified by This. | ||||
|  | ||||
|   @retval EFI_SUCCESS           The Unicode string for the user readable name in | ||||
|                                 the language specified by Language for the | ||||
|                                 driver specified by This was returned in | ||||
|                                 DriverName. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid | ||||
|                                 EFI_HANDLE. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER Language is NULL. | ||||
|  | ||||
|   @retval EFI_INVALID_PARAMETER ControllerName is NULL. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This is not currently | ||||
|                                 managing the controller specified by | ||||
|                                 ControllerHandle and ChildHandle. | ||||
|  | ||||
|   @retval EFI_UNSUPPORTED       The driver specified by This does not support | ||||
|                                 the language specified by Language. | ||||
|  | ||||
| **/ | ||||
| EFI_STATUS | ||||
| EFIAPI | ||||
| Ps2MouseComponentNameGetControllerName ( | ||||
| @@ -150,6 +259,7 @@ Ps2MouseComponentNameGetControllerName ( | ||||
|   OUT CHAR16                                          **ControllerName | ||||
|   ); | ||||
|  | ||||
|  | ||||
| EFI_STATUS | ||||
| EFIAPI | ||||
| MouseReset ( | ||||
|   | ||||
		Reference in New Issue
	
	Block a user