]>
Commit | Line | Data |
---|---|---|
83cbd279 | 1 | /** @file\r |
c6d0ee4b | 2 | Abstract:\r |
3 | \r | |
4 | Copyright (c) 2006 - 2008, Intel Corporation.<BR>\r | |
83cbd279 | 5 | All rights reserved. This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
c6d0ee4b | 7 | which accompanies this distribution. The full text of the license may be found at<BR>\r |
83cbd279 | 8 | http://opensource.org/licenses/bsd-license.php\r |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
83cbd279 | 13 | **/\r |
14 | \r | |
15 | #ifndef _ARP_DRIVER_H_\r | |
16 | #define _ARP_DRIVER_H_\r | |
17 | \r | |
772db4bb | 18 | \r |
19 | #include <PiDxe.h>\r | |
20 | \r | |
21 | #include <Protocol/Arp.h>\r | |
83cbd279 | 22 | #include <Protocol/ManagedNetwork.h>\r |
772db4bb | 23 | #include <Protocol/ServiceBinding.h>\r |
24 | \r | |
25 | #include <Library/DebugLib.h>\r | |
26 | #include <Library/UefiDriverEntryPoint.h>\r | |
27 | #include <Library/UefiBootServicesTableLib.h>\r | |
83cbd279 | 28 | #include <Library/UefiLib.h>\r |
29 | \r | |
83cbd279 | 30 | \r |
31 | //\r | |
32 | // Global variables\r | |
33 | //\r | |
34 | extern EFI_DRIVER_BINDING_PROTOCOL gArpDriverBinding;\r | |
35 | extern EFI_COMPONENT_NAME_PROTOCOL gArpComponentName;\r | |
36 | extern EFI_COMPONENT_NAME2_PROTOCOL gArpComponentName2;\r | |
37 | \r | |
c6d0ee4b | 38 | //\r |
39 | // Function prototypes for the Drivr Binding Protocol\r | |
40 | //\r | |
7bce0c5a | 41 | /**\r |
42 | Test to see if this driver supports ControllerHandle.\r | |
c6d0ee4b | 43 | \r |
44 | This service is called by the EFI boot service ConnectController(). In\r | |
45 | order to make drivers as small as possible, there are a few calling\r | |
46 | restrictions for this service. ConnectController() must\r | |
47 | follow these calling restrictions. If any other agent wishes to call\r | |
48 | Supported() it must also follow these calling restrictions.\r | |
49 | \r | |
50 | @param[in] This Protocol instance pointer.\r | |
51 | @param[in] ControllerHandle Handle of device to test.\r | |
52 | @param[in] RemainingDevicePath Optional parameter use to pick a specific child\r | |
53 | device to start.\r | |
54 | \r | |
55 | @retval EFI_SUCCES This driver supports this device\r | |
56 | @retval EFI_ALREADY_STARTED This driver is already running on this device.\r | |
57 | @retval other This driver does not support this device.\r | |
7bce0c5a | 58 | \r |
59 | **/\r | |
83cbd279 | 60 | EFI_STATUS\r |
61 | EFIAPI\r | |
62 | ArpDriverBindingSupported (\r | |
63 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
64 | IN EFI_HANDLE ControllerHandle,\r | |
65 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r | |
66 | );\r | |
67 | \r | |
7bce0c5a | 68 | /**\r |
69 | Start this driver on ControllerHandle.\r | |
c6d0ee4b | 70 | \r |
71 | This service is called by the EFI boot service ConnectController(). In order to make\r | |
72 | drivers as small as possible, there are a few calling restrictions for\r | |
73 | this service. ConnectController() must follow these\r | |
74 | calling restrictions. If any other agent wishes to call Start() it\r | |
75 | must also follow these calling restrictions.\r | |
76 | \r | |
77 | @param[in] This Protocol instance pointer.\r | |
78 | @param[in] ControllerHandle Handle of device to bind driver to.\r | |
79 | @param[in] RemainingDevicePath Optional parameter use to pick a specific child\r | |
80 | device to start.\r | |
81 | \r | |
82 | @retval EFI_SUCCES This driver is added to ControllerHandle.\r | |
83 | @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle.\r | |
84 | @retval other This driver does not support this device.\r | |
7bce0c5a | 85 | \r |
86 | **/\r | |
83cbd279 | 87 | EFI_STATUS\r |
88 | EFIAPI\r | |
89 | ArpDriverBindingStart (\r | |
90 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
91 | IN EFI_HANDLE ControllerHandle,\r | |
92 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r | |
93 | );\r | |
94 | \r | |
7bce0c5a | 95 | /**\r |
96 | Stop this driver on ControllerHandle.\r | |
c6d0ee4b | 97 | \r |
98 | This service is called by the EFI boot service DisconnectController(). In order to\r | |
99 | make drivers as small as possible, there are a few calling\r | |
100 | restrictions for this service. DisconnectController()\r | |
101 | must follow these calling restrictions. If any other agent wishes\r | |
102 | to call Stop() it must also follow these calling restrictions.\r | |
103 | \r | |
104 | @param[in] This Protocol instance pointer.\r | |
105 | @param[in] ControllerHandle Handle of device to stop driver on\r | |
106 | @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number\r | |
107 | of children is zero stop the entire bus driver.\r | |
108 | @param[in] ChildHandleBuffer List of Child Handles to Stop.\r | |
109 | \r | |
110 | @retval EFI_SUCCES This driver is removed ControllerHandle\r | |
111 | @retval other This driver was not removed from this device\r | |
7bce0c5a | 112 | \r |
113 | **/\r | |
83cbd279 | 114 | EFI_STATUS\r |
115 | EFIAPI\r | |
116 | ArpDriverBindingStop (\r | |
117 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
118 | IN EFI_HANDLE ControllerHandle,\r | |
119 | IN UINTN NumberOfChildren,\r | |
120 | IN EFI_HANDLE *ChildHandleBuffer\r | |
121 | );\r | |
122 | \r | |
7bce0c5a | 123 | /**\r |
124 | Creates a child handle with a set of I/O services.\r | |
125 | \r | |
c6d0ee4b | 126 | @param[in] This Protocol instance pointer.\r |
127 | @param[in] ChildHandle Pointer to the handle of the child to create. If\r | |
128 | it is NULL, then a new handle is created. If it is\r | |
129 | not NULL, then the I/O services are added to the\r | |
130 | existing child handle.\r | |
7bce0c5a | 131 | \r |
c6d0ee4b | 132 | @retval EFI_SUCCES The child handle was created with the I/O\r |
133 | services.\r | |
134 | @retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to create\r | |
135 | the child.\r | |
136 | @retval other The child handle was not created.\r | |
7bce0c5a | 137 | \r |
138 | **/\r | |
83cbd279 | 139 | EFI_STATUS\r |
140 | EFIAPI\r | |
141 | ArpServiceBindingCreateChild (\r | |
142 | IN EFI_SERVICE_BINDING_PROTOCOL *This,\r | |
143 | IN EFI_HANDLE *ChildHandle\r | |
144 | );\r | |
145 | \r | |
7bce0c5a | 146 | /**\r |
147 | Destroys a child handle with a set of I/O services.\r | |
148 | \r | |
c6d0ee4b | 149 | @param[in] This Protocol instance pointer.\r |
150 | @param[in] ChildHandle Handle of the child to destroy.\r | |
7bce0c5a | 151 | \r |
c6d0ee4b | 152 | @retval EFI_SUCCES The I/O services were removed from the child\r |
153 | handle.\r | |
154 | @retval EFI_UNSUPPORTED The child handle does not support the I/O services\r | |
155 | that are being removed.\r | |
156 | @retval EFI_INVALID_PARAMETER Child handle is not a valid EFI Handle.\r | |
157 | @retval EFI_ACCESS_DENIED The child handle could not be destroyed because\r | |
158 | its I/O services are being used.\r | |
159 | @retval other The child handle was not destroyed.\r | |
7bce0c5a | 160 | \r |
161 | **/\r | |
83cbd279 | 162 | EFI_STATUS\r |
163 | EFIAPI\r | |
164 | ArpServiceBindingDestroyChild (\r | |
165 | IN EFI_SERVICE_BINDING_PROTOCOL *This,\r | |
166 | IN EFI_HANDLE ChildHandle\r | |
167 | );\r | |
168 | \r | |
d354ab7f | 169 | \r |
170 | //\r | |
171 | // EFI Component Name Functions\r | |
172 | //\r | |
173 | /**\r | |
174 | Retrieves a Unicode string that is the user readable name of the driver.\r | |
175 | \r | |
176 | This function retrieves the user readable name of a driver in the form of a\r | |
177 | Unicode string. If the driver specified by This has a user readable name in\r | |
178 | the language specified by Language, then a pointer to the driver name is\r | |
179 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r | |
180 | by This does not support the language specified by Language,\r | |
181 | then EFI_UNSUPPORTED is returned.\r | |
182 | \r | |
c6d0ee4b | 183 | @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r |
d354ab7f | 184 | EFI_COMPONENT_NAME_PROTOCOL instance.\r |
185 | \r | |
c6d0ee4b | 186 | @param[in] Language A pointer to a Null-terminated ASCII string\r |
d354ab7f | 187 | array indicating the language. This is the\r |
188 | language of the driver name that the caller is\r | |
189 | requesting, and it must match one of the\r | |
190 | languages specified in SupportedLanguages. The\r | |
191 | number of languages supported by a driver is up\r | |
192 | to the driver writer. Language is specified\r | |
193 | in RFC 3066 or ISO 639-2 language code format.\r | |
194 | \r | |
c6d0ee4b | 195 | @param[out] DriverName A pointer to the Unicode string to return.\r |
d354ab7f | 196 | This Unicode string is the name of the\r |
197 | driver specified by This in the language\r | |
198 | specified by Language.\r | |
199 | \r | |
200 | @retval EFI_SUCCESS The Unicode string for the Driver specified by\r | |
201 | This and the language specified by Language was\r | |
202 | returned in DriverName.\r | |
203 | \r | |
204 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
205 | \r | |
206 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r | |
207 | \r | |
208 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
209 | the language specified by Language.\r | |
210 | \r | |
211 | **/\r | |
212 | EFI_STATUS\r | |
213 | EFIAPI\r | |
214 | ArpComponentNameGetDriverName (\r | |
215 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
216 | IN CHAR8 *Language,\r | |
217 | OUT CHAR16 **DriverName\r | |
218 | );\r | |
219 | \r | |
220 | \r | |
221 | /**\r | |
222 | Retrieves a Unicode string that is the user readable name of the controller\r | |
223 | that is being managed by a driver.\r | |
224 | \r | |
225 | This function retrieves the user readable name of the controller specified by\r | |
226 | ControllerHandle and ChildHandle in the form of a Unicode string. If the\r | |
227 | driver specified by This has a user readable name in the language specified by\r | |
228 | Language, then a pointer to the controller name is returned in ControllerName,\r | |
229 | and EFI_SUCCESS is returned. If the driver specified by This is not currently\r | |
230 | managing the controller specified by ControllerHandle and ChildHandle,\r | |
231 | then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r | |
232 | support the language specified by Language, then EFI_UNSUPPORTED is returned.\r | |
233 | \r | |
c6d0ee4b | 234 | @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r |
d354ab7f | 235 | EFI_COMPONENT_NAME_PROTOCOL instance.\r |
236 | \r | |
c6d0ee4b | 237 | @param[in] ControllerHandle The handle of a controller that the driver\r |
d354ab7f | 238 | specified by This is managing. This handle\r |
239 | specifies the controller whose name is to be\r | |
240 | returned.\r | |
241 | \r | |
c6d0ee4b | 242 | @param[in] ChildHandle The handle of the child controller to retrieve\r |
d354ab7f | 243 | the name of. This is an optional parameter that\r |
244 | may be NULL. It will be NULL for device\r | |
245 | drivers. It will also be NULL for a bus drivers\r | |
246 | that wish to retrieve the name of the bus\r | |
247 | controller. It will not be NULL for a bus\r | |
248 | driver that wishes to retrieve the name of a\r | |
249 | child controller.\r | |
250 | \r | |
c6d0ee4b | 251 | @param[in] Language A pointer to a Null-terminated ASCII string\r |
d354ab7f | 252 | array indicating the language. This is the\r |
253 | language of the driver name that the caller is\r | |
254 | requesting, and it must match one of the\r | |
255 | languages specified in SupportedLanguages. The\r | |
256 | number of languages supported by a driver is up\r | |
257 | to the driver writer. Language is specified in\r | |
258 | RFC 3066 or ISO 639-2 language code format.\r | |
259 | \r | |
c6d0ee4b | 260 | @param[out] ControllerName A pointer to the Unicode string to return.\r |
d354ab7f | 261 | This Unicode string is the name of the\r |
262 | controller specified by ControllerHandle and\r | |
263 | ChildHandle in the language specified by\r | |
264 | Language from the point of view of the driver\r | |
265 | specified by This.\r | |
266 | \r | |
267 | @retval EFI_SUCCESS The Unicode string for the user readable name in\r | |
268 | the language specified by Language for the\r | |
269 | driver specified by This was returned in\r | |
270 | DriverName.\r | |
271 | \r | |
272 | @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r | |
273 | \r | |
274 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r | |
275 | EFI_HANDLE.\r | |
276 | \r | |
277 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
278 | \r | |
279 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r | |
280 | \r | |
281 | @retval EFI_UNSUPPORTED The driver specified by This is not currently\r | |
282 | managing the controller specified by\r | |
283 | ControllerHandle and ChildHandle.\r | |
284 | \r | |
285 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
286 | the language specified by Language.\r | |
287 | \r | |
288 | **/\r | |
289 | EFI_STATUS\r | |
290 | EFIAPI\r | |
291 | ArpComponentNameGetControllerName (\r | |
292 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
293 | IN EFI_HANDLE ControllerHandle,\r | |
294 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
295 | IN CHAR8 *Language,\r | |
296 | OUT CHAR16 **ControllerName\r | |
297 | );\r | |
298 | \r | |
299 | \r | |
83cbd279 | 300 | #endif\r |
301 | \r |