]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.h
7de29e37ebb52945686f69b086233ce2f9bf892a
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Driver.h
1 /** @file
2
3 Copyright (c) 2005 - 2007, 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
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 **/
13
14 #ifndef __EFI_IP4_DRIVER_H__
15 #define __EFI_IP4_DRIVER_H__
16
17 #include <Protocol/ServiceBinding.h>
18
19 extern EFI_DRIVER_BINDING_PROTOCOL gIp4DriverBinding;
20 extern EFI_COMPONENT_NAME_PROTOCOL gIp4ComponentName;
21 extern EFI_COMPONENT_NAME2_PROTOCOL gIp4ComponentName2;
22
23 //
24 // Function prototype for the driver's entry point
25 //
26 /**
27 This is the declaration of an EFI image entry point. This entry point is
28 the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
29 both device drivers and bus drivers.
30
31 The entry point for IP4 driver which install the driver
32 binding and component name protocol on its image.
33
34 @param[in] ImageHandle The firmware allocated handle for the UEFI image.
35 @param[in] SystemTable A pointer to the EFI System Table.
36
37 @retval EFI_SUCCESS The operation completed successfully.
38 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
39
40 **/
41 EFI_STATUS
42 EFIAPI
43 Ip4DriverEntryPoint (
44 IN EFI_HANDLE ImageHandle,
45 IN EFI_SYSTEM_TABLE *SystemTable
46 );
47
48 //
49 // Function prototypes for the Drivr Binding Protocol
50 //
51 /**
52 Test to see if this driver supports ControllerHandle. This service
53 is called by the EFI boot service ConnectController(). In
54 order to make drivers as small as possible, there are a few calling
55 restrictions for this service. ConnectController() must
56 follow these calling restrictions. If any other agent wishes to call
57 Supported() it must also follow these calling restrictions.
58
59 @param[in] This Protocol instance pointer.
60 @param[in] ControllerHandle Handle of device to test
61 @param[in] RemainingDevicePath Optional parameter use to pick a specific child
62 device to start.
63
64 @retval EFI_SUCCESS This driver supports this device
65 @retval EFI_ALREADY_STARTED This driver is already running on this device
66 @retval other This driver does not support this device
67
68 **/
69 EFI_STATUS
70 EFIAPI
71 Ip4DriverBindingSupported (
72 IN EFI_DRIVER_BINDING_PROTOCOL * This,
73 IN EFI_HANDLE ControllerHandle,
74 IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
75 );
76
77 /**
78 Start this driver on ControllerHandle. This service is called by the
79 EFI boot service ConnectController(). In order to make
80 drivers as small as possible, there are a few calling restrictions for
81 this service. ConnectController() must follow these
82 calling restrictions. If any other agent wishes to call Start() it
83 must also follow these calling restrictions.
84
85 @param[in] This Protocol instance pointer.
86 @param[in] ControllerHandle Handle of device to bind driver to
87 @param[in] RemainingDevicePath Optional parameter use to pick a specific child
88 device to start.
89
90 @retval EFI_SUCCESS This driver is added to ControllerHandle
91 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
92 @retval other This driver does not support this device
93
94 **/
95 EFI_STATUS
96 EFIAPI
97 Ip4DriverBindingStart (
98 IN EFI_DRIVER_BINDING_PROTOCOL * This,
99 IN EFI_HANDLE ControllerHandle,
100 IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
101 );
102
103 /**
104 Stop this driver on ControllerHandle. This service is called by the
105 EFI boot service DisconnectController(). In order to
106 make drivers as small as possible, there are a few calling
107 restrictions for this service. DisconnectController()
108 must follow these calling restrictions. If any other agent wishes
109 to call Stop() it must also follow these calling restrictions.
110
111 @param[in] This Protocol instance pointer.
112 @param[in] ControllerHandle Handle of device to stop driver on
113 @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number
114 of children is zero stop the entire bus driver.
115 @param[in] ChildHandleBuffer List of Child Handles to Stop.
116
117 @retval EFI_SUCCESS This driver is removed ControllerHandle
118 @retval other This driver was not removed from this device
119
120 **/
121 EFI_STATUS
122 EFIAPI
123 Ip4DriverBindingStop (
124 IN EFI_DRIVER_BINDING_PROTOCOL *This,
125 IN EFI_HANDLE ControllerHandle,
126 IN UINTN NumberOfChildren,
127 IN EFI_HANDLE *ChildHandleBuffer
128 );
129
130 //
131 // Function ptototypes for the ServiceBinding Prococol
132 //
133 /**
134 Creates a child handle and installs a protocol.
135
136 The CreateChild() function installs a protocol on ChildHandle.
137 If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
138 If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
139
140 @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
141 @param ChildHandle Pointer to the handle of the child to create. If it is NULL,
142 then a new handle is created. If it is a pointer to an existing UEFI handle,
143 then the protocol is added to the existing UEFI handle.
144
145 @retval EFI_SUCCES The protocol was added to ChildHandle.
146 @retval EFI_INVALID_PARAMETER ChildHandle is NULL.
147 @retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to create
148 the child
149 @retval other The child handle was not created
150
151 **/
152 EFI_STATUS
153 EFIAPI
154 Ip4ServiceBindingCreateChild (
155 IN EFI_SERVICE_BINDING_PROTOCOL *This,
156 IN OUT EFI_HANDLE *ChildHandle
157 );
158
159 /**
160 Destroys a child handle with a protocol installed on it.
161
162 The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
163 that was installed by CreateChild() from ChildHandle. If the removed protocol is the
164 last protocol on ChildHandle, then ChildHandle is destroyed.
165
166 @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
167 @param ChildHandle Handle of the child to destroy
168
169 @retval EFI_SUCCES The protocol was removed from ChildHandle.
170 @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.
171 @retval EFI_INVALID_PARAMETER Child handle is not a valid UEFI Handle.
172 @retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle
173 because its services are being used.
174 @retval other The child handle was not destroyed
175
176 **/
177 EFI_STATUS
178 EFIAPI
179 Ip4ServiceBindingDestroyChild (
180 IN EFI_SERVICE_BINDING_PROTOCOL *This,
181 IN EFI_HANDLE ChildHandle
182 );
183 #endif