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