]>
Commit | Line | Data |
---|---|---|
6a690e23 | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2007 Intel Corporation. All rights reserved\r | |
4 | This software and associated documentation (if any) is furnished\r | |
5 | under a license and may only be used or copied in accordance\r | |
6 | with the terms of the license. Except as permitted by such\r | |
7 | license, no part of this software or documentation may be\r | |
8 | reproduced, stored in a retrieval system, or transmitted in any\r | |
9 | form or by any means without the express written consent of\r | |
10 | Intel Corporation.\r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | ComponentName.c\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | ComponentName protocol for iSCSI.\r | |
19 | \r | |
20 | --*/\r | |
21 | \r | |
22 | #include "IScsiImpl.h"\r | |
23 | \r | |
24 | //\r | |
25 | // EFI Component Name Protocol\r | |
26 | //\r | |
27 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gIScsiComponentName = {\r | |
28 | IScsiComponentNameGetDriverName,\r | |
29 | IScsiComponentNameGetControllerName,\r | |
30 | "eng"\r | |
31 | };\r | |
32 | \r | |
33 | //\r | |
34 | // EFI Component Name 2 Protocol\r | |
35 | //\r | |
36 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gIScsiComponentName2 = {\r | |
37 | (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) IScsiComponentNameGetDriverName,\r | |
38 | (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) IScsiComponentNameGetControllerName,\r | |
39 | "en"\r | |
40 | };\r | |
41 | \r | |
42 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mIScsiDriverNameTable[] = {\r | |
43 | {"eng;en", L"iSCSI Driver"}, \r | |
44 | {NULL, NULL}\r | |
45 | };\r | |
46 | \r | |
47 | EFI_STATUS\r | |
48 | EFIAPI\r | |
49 | IScsiComponentNameGetDriverName (\r | |
50 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
51 | IN CHAR8 *Language,\r | |
52 | OUT CHAR16 **DriverName\r | |
53 | )\r | |
54 | /*++\r | |
55 | \r | |
56 | Routine Description:\r | |
57 | Retrieves a Unicode string that is the user readable name of the EFI Driver.\r | |
58 | \r | |
59 | Arguments:\r | |
60 | This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
61 | Language - A pointer to a three character ISO 639-2 language identifier.\r | |
62 | This is the language of the driver name that that the caller \r | |
63 | is requesting, and it must match one of the languages specified\r | |
64 | in SupportedLanguages. The number of languages supported by a \r | |
65 | driver is up to the driver writer.\r | |
66 | DriverName - A pointer to the Unicode string to return. This Unicode string\r | |
67 | is the name of the driver specified by This in the language \r | |
68 | specified by Language.\r | |
69 | \r | |
70 | Returns:\r | |
71 | EFI_SUCCESS - The Unicode string for the Driver specified by This\r | |
72 | and the language specified by Language was returned \r | |
73 | in DriverName.\r | |
74 | EFI_INVALID_PARAMETER - Language is NULL.\r | |
75 | EFI_INVALID_PARAMETER - DriverName is NULL.\r | |
76 | EFI_UNSUPPORTED - The driver specified by This does not support the \r | |
77 | language specified by Language.\r | |
78 | \r | |
79 | --*/\r | |
80 | {\r | |
81 | return LookupUnicodeString2 (\r | |
82 | Language,\r | |
83 | This->SupportedLanguages,\r | |
84 | mIScsiDriverNameTable,\r | |
85 | DriverName,\r | |
86 | (BOOLEAN)(This == &gIScsiComponentName)\r | |
87 | );\r | |
88 | }\r | |
89 | \r | |
90 | EFI_STATUS\r | |
91 | EFIAPI\r | |
92 | IScsiComponentNameGetControllerName (\r | |
93 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
94 | IN EFI_HANDLE ControllerHandle,\r | |
95 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
96 | IN CHAR8 *Language,\r | |
97 | OUT CHAR16 **ControllerName\r | |
98 | )\r | |
99 | /*++\r | |
100 | \r | |
101 | Routine Description:\r | |
102 | Retrieves a Unicode string that is the user readable name of the controller\r | |
103 | that is being managed by an EFI Driver.\r | |
104 | \r | |
105 | Arguments:\r | |
106 | This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
107 | ControllerHandle - The handle of a controller that the driver specified by \r | |
108 | This is managing. This handle specifies the controller \r | |
109 | whose name is to be returned.\r | |
110 | ChildHandle - The handle of the child controller to retrieve the name \r | |
111 | of. This is an optional parameter that may be NULL. It \r | |
112 | will be NULL for device drivers. It will also be NULL \r | |
113 | for a bus drivers that wish to retrieve the name of the \r | |
114 | bus controller. It will not be NULL for a bus driver \r | |
115 | that wishes to retrieve the name of a child controller.\r | |
116 | Language - A pointer to a three character ISO 639-2 language \r | |
117 | identifier. This is the language of the controller name \r | |
118 | that that the caller is requesting, and it must match one\r | |
119 | of the languages specified in SupportedLanguages. The \r | |
120 | number of languages supported by a driver is up to the \r | |
121 | driver writer.\r | |
122 | ControllerName - A pointer to the Unicode string to return. This Unicode\r | |
123 | string is the name of the controller specified by \r | |
124 | ControllerHandle and ChildHandle in the language \r | |
125 | specified by Language from the point of view of the \r | |
126 | driver specified by This. \r | |
127 | \r | |
128 | Returns:\r | |
129 | EFI_SUCCESS - The Unicode string for the user readable name in the \r | |
130 | language specified by Language for the driver \r | |
131 | specified by This was returned in DriverName.\r | |
132 | EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r | |
133 | EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid \r | |
134 | EFI_HANDLE.\r | |
135 | EFI_INVALID_PARAMETER - Language is NULL.\r | |
136 | EFI_INVALID_PARAMETER - ControllerName is NULL.\r | |
137 | EFI_UNSUPPORTED - The driver specified by This is not currently \r | |
138 | managing the controller specified by \r | |
139 | ControllerHandle and ChildHandle.\r | |
140 | EFI_UNSUPPORTED - The driver specified by This does not support the \r | |
141 | language specified by Language.\r | |
142 | \r | |
143 | --*/\r | |
144 | {\r | |
145 | return EFI_UNSUPPORTED;\r | |
146 | }\r |