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