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