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