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