1 /** @file
2   Header file for implementation of UEFI Component Name(2) protocol.
3 
4 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution.  The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9 
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 
13 **/
14 
15 #ifndef _COMPONENT_NAME_H_
16 #define _COMPONENT_NAME_H_
17 
18 #define FLOPPY_DRIVE_NAME      L"ISA Floppy Drive # "
19 #define FLOPPY_DRIVE_NAME_LEN  ((sizeof (FLOPPY_DRIVE_NAME) / sizeof (CHAR16)) - 1)
20 
21 extern EFI_COMPONENT_NAME_PROTOCOL   gIsaFloppyComponentName;
22 extern EFI_COMPONENT_NAME2_PROTOCOL  gIsaFloppyComponentName2;
23 
24 /**
25   Retrieves a Unicode string that is the user readable name of the driver.
26 
27   This function retrieves the user readable name of a driver in the form of a
28   Unicode string. If the driver specified by This has a user readable name in
29   the language specified by Language, then a pointer to the driver name is
30   returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
31   by This does not support the language specified by Language,
32   then EFI_UNSUPPORTED is returned.
33 
34   @param[in]  This              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
35                                 EFI_COMPONENT_NAME_PROTOCOL instance.
36   @param[in]  Language          A pointer to a Null-terminated ASCII string
37                                 array indicating the language. This is the
38                                 language of the driver name that the caller is
39                                 requesting, and it must match one of the
40                                 languages specified in SupportedLanguages. The
41                                 number of languages supported by a driver is up
42                                 to the driver writer. Language is specified
43                                 in RFC 4646 or ISO 639-2 language code format.
44   @param[out]  DriverName       A pointer to the Unicode string to return.
45                                 This Unicode string is the name of the
46                                 driver specified by This in the language
47                                 specified by Language.
48   @retval EFI_SUCCESS           The Unicode string for the Driver specified by
49                                 This and the language specified by Language was
50                                 returned in DriverName.
51 
52   @retval EFI_INVALID_PARAMETER Language is NULL.
53   @retval EFI_INVALID_PARAMETER DriverName is NULL.
54   @retval EFI_UNSUPPORTED       The driver specified by This does not support
55                                 the language specified by Language.
56 **/
57 EFI_STATUS
58 EFIAPI
59 IsaFloppyComponentNameGetDriverName (
60   IN  EFI_COMPONENT_NAME_PROTOCOL  *This,
61   IN  CHAR8                        *Language,
62   OUT CHAR16                       **DriverName
63   );
64 
65 
66 /**
67   Retrieves a Unicode string that is the user readable name of the controller
68   that is being managed by a driver.
69 
70   This function retrieves the user readable name of the controller specified by
71   ControllerHandle and ChildHandle in the form of a Unicode string. If the
72   driver specified by This has a user readable name in the language specified by
73   Language, then a pointer to the controller name is returned in ControllerName,
74   and EFI_SUCCESS is returned.  If the driver specified by This is not currently
75   managing the controller specified by ControllerHandle and ChildHandle,
76   then EFI_UNSUPPORTED is returned.  If the driver specified by This does not
77   support the language specified by Language, then EFI_UNSUPPORTED is returned.
78 
79   @param[in]  This              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
80                                 EFI_COMPONENT_NAME_PROTOCOL instance.
81   @param[in]  ControllerHandle  The handle of a controller that the driver
82                                 specified by This is managing.  This handle
83                                 specifies the controller whose name is to be
84                                 returned.
85   @param[in]  ChildHandle       The handle of the child controller to retrieve
86                                 the name of.  This is an optional parameter that
87                                 may be NULL.  It will be NULL for device
88                                 drivers.  It will also be NULL for a bus drivers
89                                 that wish to retrieve the name of the bus
90                                 controller.  It will not be NULL for a bus
91                                 driver that wishes to retrieve the name of a
92                                 child controller.
93   @param[in]  Language          A pointer to a Null-terminated ASCII string
94                                 array indicating the language.  This is the
95                                 language of the driver name that the caller is
96                                 requesting, and it must match one of the
97                                 languages specified in SupportedLanguages. The
98                                 number of languages supported by a driver is up
99                                 to the driver writer. Language is specified in
100                                 RFC 4646 or ISO 639-2 language code format.
101   @param[out]  ControllerName   A pointer to the Unicode string to return.
102                                 This Unicode string is the name of the
103                                 controller specified by ControllerHandle and
104                                 ChildHandle in the language specified by
105                                 Language from the point of view of the driver
106                                 specified by This.
107 
108   @retval EFI_SUCCESS           The Unicode string for the user readable name in
109                                 the language specified by Language for the
110                                 driver specified by This was returned in
111                                 DriverName.
112   @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
113   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
114                                 EFI_HANDLE.
115   @retval EFI_INVALID_PARAMETER Language is NULL.
116   @retval EFI_INVALID_PARAMETER ControllerName is NULL.
117   @retval EFI_UNSUPPORTED       The driver specified by This is not currently
118                                 managing the controller specified by
119                                 ControllerHandle and ChildHandle.
120   @retval EFI_UNSUPPORTED       The driver specified by This does not support
121                                 the language specified by Language.
122 **/
123 EFI_STATUS
124 EFIAPI
125 IsaFloppyComponentNameGetControllerName (
126   IN  EFI_COMPONENT_NAME_PROTOCOL  *This,
127   IN  EFI_HANDLE                   ControllerHandle,
128   IN  EFI_HANDLE                   ChildHandle  OPTIONAL,
129   IN  CHAR8                        *Language,
130   OUT CHAR16                       **ControllerName
131   );
132 
133 
134 /**
135   Add the component name for the floppy device
136 
137   @param[in]  FdcDev  A pointer to the FDC_BLK_IO_DEV instance.
138 
139 **/
140 VOID
141 AddName (
142   IN  FDC_BLK_IO_DEV  *FdcDev
143   );
144 
145 #endif
146 
147