Fix a bug about the iSCSI DHCP dependency issue.
[mirror_edk2.git] / NetworkPkg / Udp6Dxe / Udp6Driver.h
CommitLineData
a3bcde70
HT
1/** @file\r
2 Driver Binding functions and Service Binding functions for the Network driver module.\r
3\r
15ee13fc 4 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
a3bcde70
HT
5\r
6 This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php.\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#ifndef _UDP6_DRIVER_H_\r
17#define _UDP6_DRIVER_H_\r
18\r
19#include <Protocol/DriverBinding.h>\r
20#include <Protocol/ServiceBinding.h>\r
21#include <Protocol/DevicePath.h>\r
22\r
23/**\r
24 Tests to see if this driver supports a given controller. If a child device is provided,\r
25 it further tests to see if this driver supports creating a handle for the specified child device.\r
26\r
27 This function checks to see if the driver specified by This supports the device specified by\r
28 ControllerHandle. Drivers typically use the device path attached to\r
29 ControllerHandle and/or the services from the bus I/O abstraction attached to\r
30 ControllerHandle to determine if the driver supports ControllerHandle. This function\r
31 may be called many times during platform initialization. In order to reduce boot times, the tests\r
32 performed by this function must be very small, and take as little time as possible to execute. This\r
33 function must not change the state of any hardware devices, and this function must be aware that the\r
34 device specified by ControllerHandle may already be managed by the same driver or a\r
35 different driver. This function must match its calls to AllocatePages() with FreePages(),\r
36 AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().\r
37 Since ControllerHandle may have been previously started by the same driver, if a protocol is\r
38 already in the opened state, then it must not be closed with CloseProtocol(). This is required\r
39 to guarantee the state of ControllerHandle is not modified by this function.\r
40\r
41 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
42 @param[in] ControllerHandle The handle of the controller to test. This handle\r
43 must support a protocol interface that supplies\r
44 an I/O abstraction to the driver.\r
45 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r
46 parameter is ignored by device drivers, and is optional for bus\r
47 drivers. For bus drivers, if this parameter is not NULL, then\r
48 the bus driver must determine if the bus controller specified\r
49 by ControllerHandle and the child controller specified\r
50 by RemainingDevicePath are both supported by this\r
51 bus driver.\r
52\r
53 @retval EFI_SUCCESS The device specified by ControllerHandle and\r
54 RemainingDevicePath is supported by the driver specified by This.\r
55 @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and\r
56 RemainingDevicePath is already being managed by the driver\r
57 specified by This.\r
58 @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and\r
59 RemainingDevicePath is already being managed by a different\r
60 driver or an application that requires exclusive access.\r
61 Currently not implemented.\r
62 @retval EFI_UNSUPPORTED The device specified by ControllerHandle and\r
63 RemainingDevicePath is not supported by the driver specified by This.\r
64**/\r
65EFI_STATUS\r
66EFIAPI\r
67Udp6DriverBindingSupported (\r
68 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
69 IN EFI_HANDLE ControllerHandle,\r
70 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
71 );\r
72\r
73/**\r
74 Start this driver on ControllerHandle.\r
75\r
76 This service is called by the EFI boot service ConnectController(). In order to make\r
77 drivers as small as possible, there are a few calling restrictions for\r
78 this service. ConnectController() must follow these\r
79 calling restrictions. If any other agent wishes to call Start() it\r
80 must also follow these calling restrictions.\r
81\r
82 @param[in] This Protocol instance pointer.\r
83 @param[in] ControllerHandle Handle of device to bind a driver to.\r
84 @param[in] RemainingDevicePath Optional parameter use to pick a specific child\r
85 device to start.\r
86\r
87 @retval EFI_SUCCES This driver is added to ControllerHandle.\r
88 @retval EFI_OUT_OF_RESOURCES The required system resource can't be allocated.\r
89 @retval other This driver does not support this device.\r
90\r
91**/\r
92EFI_STATUS\r
93EFIAPI\r
94Udp6DriverBindingStart (\r
95 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
96 IN EFI_HANDLE ControllerHandle,\r
97 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
98 );\r
99\r
100/**\r
101 Stop this driver on ControllerHandle.\r
102\r
103 This service is called by the EFI boot service DisconnectController(). In order to\r
104 make drivers as small as possible, there are a few calling\r
105 restrictions for this service. DisconnectController()\r
106 must follow these calling restrictions. If any other agent wishes\r
107 to call Stop(), it must also follow these calling restrictions.\r
108\r
109 @param[in] This Protocol instance pointer.\r
110 @param[in] ControllerHandle Handle of device to stop the driver on.\r
111 @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number\r
112 of children is zero, stop the entire bus driver.\r
113 @param[in] ChildHandleBuffer List of Child Handles to Stop. It is optional.\r
114\r
115 @retval EFI_SUCCESS This driver removed ControllerHandle.\r
116 @retval EFI_DEVICE_ERROR Can't find the NicHandle from the ControllerHandle and specified GUID.\r
117 @retval other This driver was not removed from this device.\r
118\r
119**/\r
120EFI_STATUS\r
121EFIAPI\r
122Udp6DriverBindingStop (\r
123 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
124 IN EFI_HANDLE ControllerHandle,\r
125 IN UINTN NumberOfChildren,\r
126 IN EFI_HANDLE *ChildHandleBuffer OPTIONAL\r
127 );\r
128\r
129/**\r
130 Creates a child handle and installs a protocol.\r
131\r
132 The CreateChild() function installs a protocol on ChildHandle.\r
133 If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.\r
134 If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.\r
135\r
136 @param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
137 @param[in, out] ChildHandle Pointer to the handle of the child to create. If it is NULL,\r
138 then a new handle is created. If it is a pointer to an existing UEFI handle,\r
139 then the protocol is added to the existing UEFI handle.\r
140\r
141 @retval EFI_SUCCES The protocol was added to ChildHandle.\r
142 @retval EFI_INVALID_PARAMETER This is NULL or ChildHandle is NULL.\r
143 @retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to create\r
144 the child.\r
145 @retval other The child handle was not created.\r
146\r
147**/\r
148EFI_STATUS\r
149EFIAPI\r
150Udp6ServiceBindingCreateChild (\r
151 IN EFI_SERVICE_BINDING_PROTOCOL *This,\r
152 IN OUT EFI_HANDLE *ChildHandle\r
153 );\r
154\r
155/**\r
156 Destroys a child handle with a set of I/O services.\r
157 The DestroyChild() function does the opposite of CreateChild(). It removes a protocol\r
158 that was installed by CreateChild() from ChildHandle. If the removed protocol is the\r
159 last protocol on ChildHandle, then ChildHandle is destroyed.\r
160\r
161 @param[in] This Protocol instance pointer.\r
162 @param[in] ChildHandle Handle of the child to destroy.\r
163\r
164 @retval EFI_SUCCES The I/O services were removed from the child\r
165 handle.\r
166 @retval EFI_UNSUPPORTED The child handle does not support the I/O services\r
167 that are being removed.\r
15ee13fc 168 @retval EFI_INVALID_PARAMETER Child handle is NULL.\r
a3bcde70
HT
169 @retval EFI_ACCESS_DENIED The child handle could not be destroyed because\r
170 its I/O services are being used.\r
171 @retval other The child handle was not destroyed.\r
172\r
173**/\r
174EFI_STATUS\r
175EFIAPI\r
176Udp6ServiceBindingDestroyChild (\r
177 IN EFI_SERVICE_BINDING_PROTOCOL *This,\r
178 IN EFI_HANDLE ChildHandle\r
179 );\r
180\r
181#endif\r
182\r