]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.h
[Description]
[mirror_edk2.git] / MdeModulePkg / Universal / Network / IScsiDxe / IScsiDriver.h
CommitLineData
12618416 1/** @file\r
2 The header file of IScsiDriver.c\r
6a690e23 3\r
9cb8724d 4Copyright (c) 2004 - 2008, Intel Corporation\r
7a444476 5All rights reserved. This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
6a690e23 12\r
13Module Name:\r
14\r
15 IScsiDriver.h\r
16\r
17Abstract:\r
12618416 18 The header file of IScsiDriver.c\r
6a690e23 19\r
12618416 20**/\r
6a690e23 21\r
22#ifndef _ISCSI_DRIVER_H_\r
23#define _ISCSI_DRIVER_H_\r
24\r
25#include <PiDxe.h>\r
26#include <Protocol/DevicePath.h>\r
27#include <Protocol/LoadedImage.h>\r
28#include <Library/UefiDriverEntryPoint.h>\r
29#include <Library/UefiBootServicesTableLib.h>\r
30#include <Library/UefiLib.h>\r
31#include <Library/DevicePathLib.h>\r
9cb8724d 32#include <Protocol/DriverBinding.h>\r
33#include <Protocol/ScsiPassThruExt.h>\r
34#include <Protocol/IScsiInitiatorName.h>\r
35#include <Protocol/Ip4Config.h>\r
36#include <Protocol/ComponentName.h>\r
37#include <Protocol/ComponentName2.h>\r
6a690e23 38\r
39#define ISCSI_PRIVATE_GUID \\r
40 { \\r
41 0xfa3cde4c, 0x87c2, 0x427d, 0xae, 0xde, 0x7d, 0xd0, 0x96, 0xc8, 0x8c, 0x58 \\r
42 }\r
43\r
44#define ISCSI_INITIATOR_NAME_VAR_NAME L"I_NAME"\r
45\r
46extern EFI_COMPONENT_NAME2_PROTOCOL gIScsiComponentName2;\r
47extern EFI_COMPONENT_NAME_PROTOCOL gIScsiComponentName;\r
48\r
49extern EFI_ISCSI_INITIATOR_NAME_PROTOCOL gIScsiInitiatorName;\r
50\r
51extern EFI_GUID mIScsiPrivateGuid;\r
52\r
53typedef struct _ISCSI_PRIVATE_PROTOCOL {\r
54 UINT32 Reserved;\r
55} ISCSI_PRIVATE_PROTOCOL;\r
56\r
57//\r
58// EFI Driver Binding Protocol for iSCSI driver.\r
59//\r
12618416 60/**\r
61 Test to see if IScsi driver supports the given controller. \r
62\r
63 @param This[in] Protocol instance pointer.\r
64\r
65 @param ControllerHandle[in] Handle of controller to test.\r
66\r
67 @param RemainingDevicePath[in] Optional parameter use to pick a specific child device to start.\r
68\r
69 @retval EFI_SUCCES This driver supports the controller.\r
70\r
71 @retval EFI_ALREADY_STARTED This driver is already running on this device.\r
72\r
73 @retval EFI_UNSUPPORTED This driver doesn't support the controller.\r
74\r
75**/\r
6a690e23 76EFI_STATUS\r
77EFIAPI\r
78IScsiDriverBindingSupported (\r
79 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
80 IN EFI_HANDLE ControllerHandle,\r
81 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
82 );\r
83\r
12618416 84/**\r
85 Start to manage the controller. \r
86\r
87 @param This[in] Protocol instance pointer.\r
88\r
89 @param ControllerHandle[in] Handle of the controller.\r
90\r
91 @param RemainingDevicePath[in] Optional parameter use to pick a specific child device to start.\r
92\r
93 @retval EFI_SUCCES This driver supports this device.\r
94\r
95 @retval EFI_ALREADY_STARTED This driver is already running on this device.\r
96\r
97**/\r
6a690e23 98EFI_STATUS\r
99EFIAPI\r
100IScsiDriverBindingStart (\r
101 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
102 IN EFI_HANDLE ControllerHandle,\r
103 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
104 );\r
105\r
12618416 106/**\r
107 Release the control of this controller and remove the IScsi functions.\r
108\r
109 @param This[in] Protocol instance pointer.\r
110\r
111 @param ControllerHandle[in] Handle of controller to stop.\r
112\r
113 @param NumberOfChildren[in] Not used.\r
114\r
115 @param ChildHandleBuffer[in] Not used.\r
116\r
117 @retval EFI_SUCCES This driver supports this device.\r
118\r
119**/\r
6a690e23 120EFI_STATUS\r
121EFIAPI\r
122IScsiDriverBindingStop (\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\r
127 );\r
128\r
129//\r
12618416 130// EFI Component Name Protocol for IScsi driver.\r
6a690e23 131//\r
12618416 132/**\r
133 Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
134\r
135 This function retrieves the user readable name of a driver in the form of a\r
136 Unicode string. If the driver specified by This has a user readable name in\r
137 the language specified by Language, then a pointer to the driver name is\r
138 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
139 by This does not support the language specified by Language,\r
140 then EFI_UNSUPPORTED is returned.\r
141\r
142 @param This[in] A pointer to the EFI_COMPONENT_NAME_PROTOCOL\r
143 instance.\r
144\r
145 @param Language[in] A pointer to a three character ISO 639-2 language\r
146 identifier.\r
147 This is the language of the driver name that that\r
148 the caller is requesting, and it must match one of\r
149 the languages specified in SupportedLanguages. \r
150 The number of languages supported by a driver is up\r
151 to the driver writer.\r
152\r
153 @param DriverName[out] A pointer to the Unicode string to return.\r
154 This Unicode string is the name of the\r
155 driver specified by This in the language\r
156 specified by Language.\r
157\r
158 @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
159 This and the language specified by Language was\r
160 returned in DriverName.\r
161\r
162 @retval EFI_INVALID_PARAMETER Language is NULL.\r
163\r
164 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
165\r
166 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
167 the language specified by Language.\r
168\r
169**/\r
6a690e23 170EFI_STATUS\r
171EFIAPI\r
172IScsiComponentNameGetDriverName (\r
173 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
174 IN CHAR8 *Language,\r
175 OUT CHAR16 **DriverName\r
176 );\r
177\r
12618416 178/**\r
179 Retrieves a Unicode string that is the user readable name of the controller\r
180 that is being managed by an EFI Driver.\r
181\r
182 @param This[in] A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
183\r
184 @param ControllerHandle[in] The handle of a controller that the driver specified by\r
185 This is managing. This handle specifies the controller\r
186 whose name is to be returned.\r
187\r
188 @param ChildHandle[in] The handle of the child controller to retrieve the name\r
189 of. This is an optional parameter that may be NULL. It\r
190 will be NULL for device drivers. It will also be NULL\r
191 for a bus drivers that wish to retrieve the name of the\r
192 bus controller. It will not be NULL for a bus driver\r
193 that wishes to retrieve the name of a child controller.\r
194\r
195 @param Language[in] A pointer to a three character ISO 639-2 language \r
196 identifier. This is the language of the controller name\r
197 that that the caller is requesting, and it must match one\r
198 of the languages specified in SupportedLanguages. The\r
199 number of languages supported by a driver is up to the\r
200 driver writer.\r
201\r
202 @param ControllerName[out] A pointer to the Unicode string to return. This Unicode\r
203 string is the name of the controller specified by \r
204 ControllerHandle and ChildHandle in the language \r
205 specified by Language from the point of view of the \r
206 driver specified by This. \r
207\r
208 @retval EFI_SUCCESS The Unicode string for the user readable name in the \r
209 language specified by Language for the driver \r
210 specified by This was returned in DriverName.\r
211\r
212 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
213\r
214 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
215\r
216 @retval EFI_INVALID_PARAMETER Language is NULL.\r
217\r
218 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
219\r
220 @retval EFI_UNSUPPORTED The driver specified by This is not currently managing\r
221 the controller specified by ControllerHandle and ChildHandle.\r
222\r
223 @retval EFI_UNSUPPORTED The driver specified by This does not support the \r
224 language specified by Language.\r
225\r
226**/\r
6a690e23 227EFI_STATUS\r
228EFIAPI\r
229IScsiComponentNameGetControllerName (\r
230 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
231 IN EFI_HANDLE ControllerHandle,\r
232 IN EFI_HANDLE ChildHandle OPTIONAL,\r
233 IN CHAR8 *Language,\r
234 OUT CHAR16 **ControllerName\r
235 );\r
236\r
237//\r
12618416 238// EFI IScsi Initiator Name Protocol for IScsi driver.\r
6a690e23 239//\r
12618416 240/**\r
241 Retrieves the current set value of iSCSI Initiator Name. \r
242\r
243 @param This[in] Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL instance.\r
244\r
245 @param BufferSize[in][out] Size of the buffer in bytes pointed to by Buffer / Actual\r
246 size of the variable data buffer.\r
247\r
248 @param Buffer[out] Pointer to the buffer for data to be read.\r
249\r
250 @retval EFI_SUCCESS Data was successfully retrieved into the provided \r
251 buffer and the BufferSize was sufficient to handle the\r
252 iSCSI initiator name.\r
253 @retval EFI_BUFFER_TOO_SMALL BufferSize is too small for the result. BufferSize will\r
254 be updated with the size required to complete the request.\r
255 Buffer will not be affected.\r
256\r
257 @retval EFI_INVALID_PARAMETER BufferSize is NULL. BufferSize and Buffer will not be\r
258 affected.\r
259\r
260 @retval EFI_INVALID_PARAMETER Buffer is NULL. BufferSize and Buffer will not be\r
261 affected.\r
262\r
263 @retval EFI_DEVICE_ERROR The iSCSI initiator name could not be retrieved due to\r
264 a hardware error.\r
265\r
266**/\r
6a690e23 267EFI_STATUS\r
268EFIAPI\r
269IScsiGetInitiatorName (\r
270 IN EFI_ISCSI_INITIATOR_NAME_PROTOCOL *This,\r
271 IN OUT UINTN *BufferSize,\r
272 OUT VOID *Buffer\r
273 );\r
274\r
12618416 275/**\r
276 Sets the iSCSI Initiator Name. \r
277\r
278 @param This[in] Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL instance.\r
279\r
280 @param BufferSize[in][out] Size of the buffer in bytes pointed to by Buffer.\r
281\r
282 @param Buffer[out] Pointer to the buffer for data to be written.\r
283 \r
284 @retval EFI_SUCCESS Data was successfully stored by the protocol.\r
285\r
286 @retval EFI_UNSUPPORTED Platform policies do not allow for data to be written.\r
287\r
288 @retval EFI_INVALID_PARAMETER BufferSize exceeds the maximum allowed limit.\r
289 BufferSize will be updated with the maximum size\r
290 required to complete the request.\r
291\r
292 @retval EFI_INVALID_PARAMETER Buffersize is NULL. BufferSize and Buffer will not be\r
293 affected.\r
294\r
295 @retval EFI_INVALID_PARAMETER Buffer is NULL. BufferSize and Buffer will not be affected.\r
296\r
297 @retval EFI_DEVICE_ERROR The data could not be stored due to a hardware error.\r
298\r
299 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the data.\r
300\r
301 @retval EFI_PROTOCOL_ERROR Input iSCSI initiator name does not adhere to RFC 3720.\r
302\r
303**/\r
6a690e23 304EFI_STATUS\r
305EFIAPI\r
306IScsiSetInitiatorName (\r
307 IN EFI_ISCSI_INITIATOR_NAME_PROTOCOL *This,\r
308 IN OUT UINTN *BufferSize,\r
309 OUT VOID *Buffer\r
310 );\r
311\r
312#endif\r