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