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
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.
21 #ifndef _ARP_DRIVER_H_
22 #define _ARP_DRIVER_H_
27 #include <Protocol/Arp.h>
28 #include <Protocol/ManagedNetwork.h>
29 #include <Protocol/ServiceBinding.h>
31 #include <Library/DebugLib.h>
32 #include <Library/UefiDriverEntryPoint.h>
33 #include <Library/UefiBootServicesTableLib.h>
34 #include <Library/UefiLib.h>
40 extern EFI_DRIVER_BINDING_PROTOCOL gArpDriverBinding
;
41 extern EFI_COMPONENT_NAME_PROTOCOL gArpComponentName
;
42 extern EFI_COMPONENT_NAME2_PROTOCOL gArpComponentName2
;
45 Test to see if this driver supports ControllerHandle.
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
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.
59 ArpDriverBindingSupported (
60 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
61 IN EFI_HANDLE ControllerHandle
,
62 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
66 Start this driver on ControllerHandle.
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
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
80 ArpDriverBindingStart (
81 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
82 IN EFI_HANDLE ControllerHandle
,
83 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
87 Stop this driver on ControllerHandle.
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.
95 @retval EFI_SUCCES This driver is removed ControllerHandle
96 @retval other This driver was not removed from this device
101 ArpDriverBindingStop (
102 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
103 IN EFI_HANDLE ControllerHandle
,
104 IN UINTN NumberOfChildren
,
105 IN EFI_HANDLE
*ChildHandleBuffer
109 Creates a child handle with a set of I/O services.
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.
117 @retval EFI_SUCCES The child handle was created with the I/O
119 @retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to create
121 @retval other The child handle was not created.
126 ArpServiceBindingCreateChild (
127 IN EFI_SERVICE_BINDING_PROTOCOL
*This
,
128 IN EFI_HANDLE
*ChildHandle
132 Destroys a child handle with a set of I/O services.
134 @param This Protocol instance pointer.
135 @param ChildHandle Handle of the child to destroy.
137 @retval EFI_SUCCES The I/O services were removed from the child
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.
149 ArpServiceBindingDestroyChild (
150 IN EFI_SERVICE_BINDING_PROTOCOL
*This
,
151 IN EFI_HANDLE ChildHandle
156 // EFI Component Name Functions
159 Retrieves a Unicode string that is the user readable name of the driver.
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.
168 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
169 EFI_COMPONENT_NAME_PROTOCOL instance.
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.
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.
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.
189 @retval EFI_INVALID_PARAMETER Language is NULL.
191 @retval EFI_INVALID_PARAMETER DriverName is NULL.
193 @retval EFI_UNSUPPORTED The driver specified by This does not support
194 the language specified by Language.
199 ArpComponentNameGetDriverName (
200 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
202 OUT CHAR16
**DriverName
207 Retrieves a Unicode string that is the user readable name of the controller
208 that is being managed by a driver.
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.
219 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
220 EFI_COMPONENT_NAME_PROTOCOL instance.
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
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
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.
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
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
257 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
259 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
262 @retval EFI_INVALID_PARAMETER Language is NULL.
264 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
266 @retval EFI_UNSUPPORTED The driver specified by This is not currently
267 managing the controller specified by
268 ControllerHandle and ChildHandle.
270 @retval EFI_UNSUPPORTED The driver specified by This does not support
271 the language specified by Language.
276 ArpComponentNameGetControllerName (
277 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
278 IN EFI_HANDLE ControllerHandle
,
279 IN EFI_HANDLE ChildHandle OPTIONAL
,
281 OUT CHAR16
**ControllerName