3 Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
4 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.
14 #ifndef __EFI_IP4_DRIVER_H__
15 #define __EFI_IP4_DRIVER_H__
17 #include <Protocol/ServiceBinding.h>
19 extern EFI_DRIVER_BINDING_PROTOCOL gIp4DriverBinding
;
20 extern EFI_COMPONENT_NAME_PROTOCOL gIp4ComponentName
;
21 extern EFI_COMPONENT_NAME2_PROTOCOL gIp4ComponentName2
;
22 extern EFI_UNICODE_STRING_TABLE
*gIp4ControllerNameTable
;
25 EFI_SERVICE_BINDING_PROTOCOL
*ServiceBinding
;
26 UINTN NumberOfChildren
;
27 EFI_HANDLE
*ChildHandleBuffer
;
28 } IP4_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT
;
31 // Function prototype for the driver's entry point
34 This is the declaration of an EFI image entry point. This entry point is
35 the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
36 both device drivers and bus drivers.
38 The entry point for IP4 driver which install the driver
39 binding and component name protocol on its image.
41 @param[in] ImageHandle The firmware allocated handle for the UEFI image.
42 @param[in] SystemTable A pointer to the EFI System Table.
44 @retval EFI_SUCCESS The operation completed successfully.
45 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
51 IN EFI_HANDLE ImageHandle
,
52 IN EFI_SYSTEM_TABLE
*SystemTable
56 // Function prototypes for the Drivr Binding Protocol
59 Test to see if this driver supports ControllerHandle. This service
60 is called by the EFI boot service ConnectController(). In
61 order to make drivers as small as possible, there are a few calling
62 restrictions for this service. ConnectController() must
63 follow these calling restrictions. If any other agent wishes to call
64 Supported() it must also follow these calling restrictions.
66 @param[in] This Protocol instance pointer.
67 @param[in] ControllerHandle Handle of device to test
68 @param[in] RemainingDevicePath Optional parameter use to pick a specific child
71 @retval EFI_SUCCESS This driver supports this device
72 @retval EFI_ALREADY_STARTED This driver is already running on this device
73 @retval other This driver does not support this device
78 Ip4DriverBindingSupported (
79 IN EFI_DRIVER_BINDING_PROTOCOL
* This
,
80 IN EFI_HANDLE ControllerHandle
,
81 IN EFI_DEVICE_PATH_PROTOCOL
* RemainingDevicePath OPTIONAL
85 Start this driver on ControllerHandle. This service is called by the
86 EFI boot service ConnectController(). In order to make
87 drivers as small as possible, there are a few calling restrictions for
88 this service. ConnectController() must follow these
89 calling restrictions. If any other agent wishes to call Start() it
90 must also follow these calling restrictions.
92 @param[in] This Protocol instance pointer.
93 @param[in] ControllerHandle Handle of device to bind driver to
94 @param[in] RemainingDevicePath Optional parameter use to pick a specific child
97 @retval EFI_SUCCESS This driver is added to ControllerHandle
98 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
99 @retval other This driver does not support this device
104 Ip4DriverBindingStart (
105 IN EFI_DRIVER_BINDING_PROTOCOL
* This
,
106 IN EFI_HANDLE ControllerHandle
,
107 IN EFI_DEVICE_PATH_PROTOCOL
* RemainingDevicePath OPTIONAL
111 Stop this driver on ControllerHandle. This service is called by the
112 EFI boot service DisconnectController(). In order to
113 make drivers as small as possible, there are a few calling
114 restrictions for this service. DisconnectController()
115 must follow these calling restrictions. If any other agent wishes
116 to call Stop() it must also follow these calling restrictions.
118 @param[in] This Protocol instance pointer.
119 @param[in] ControllerHandle Handle of device to stop driver on
120 @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number
121 of children is zero stop the entire bus driver.
122 @param[in] ChildHandleBuffer List of Child Handles to Stop.
124 @retval EFI_SUCCESS This driver is removed ControllerHandle
125 @retval other This driver was not removed from this device
130 Ip4DriverBindingStop (
131 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
132 IN EFI_HANDLE ControllerHandle
,
133 IN UINTN NumberOfChildren
,
134 IN EFI_HANDLE
*ChildHandleBuffer
138 // Function ptototypes for the ServiceBinding Prococol
141 Creates a child handle and installs a protocol.
143 The CreateChild() function installs a protocol on ChildHandle.
144 If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
145 If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
147 @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
148 @param ChildHandle Pointer to the handle of the child to create. If it is NULL,
149 then a new handle is created. If it is a pointer to an existing UEFI handle,
150 then the protocol is added to the existing UEFI handle.
152 @retval EFI_SUCCES The protocol was added to ChildHandle.
153 @retval EFI_INVALID_PARAMETER ChildHandle is NULL.
154 @retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to create
156 @retval other The child handle was not created
161 Ip4ServiceBindingCreateChild (
162 IN EFI_SERVICE_BINDING_PROTOCOL
*This
,
163 IN OUT EFI_HANDLE
*ChildHandle
167 Destroys a child handle with a protocol installed on it.
169 The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
170 that was installed by CreateChild() from ChildHandle. If the removed protocol is the
171 last protocol on ChildHandle, then ChildHandle is destroyed.
173 @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
174 @param ChildHandle Handle of the child to destroy
176 @retval EFI_SUCCES The protocol was removed from ChildHandle.
177 @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.
178 @retval EFI_INVALID_PARAMETER Child handle is NULL.
179 @retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle
180 because its services are being used.
181 @retval other The child handle was not destroyed
186 Ip4ServiceBindingDestroyChild (
187 IN EFI_SERVICE_BINDING_PROTOCOL
*This
,
188 IN EFI_HANDLE ChildHandle