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