]> git.proxmox.com Git - mirror_edk2.git/blame - NetworkPkg/IScsiDxe/IScsiDriver.h
NetworkPkg: Apply uncrustify changes
[mirror_edk2.git] / NetworkPkg / IScsiDxe / IScsiDriver.h
CommitLineData
4c5a5e0c 1/** @file\r
2 The header file of IScsiDriver.c.\r
3\r
f75a7f56 4Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
483ee515 5(C) Copyright 2017 Hewlett Packard Enterprise Development LP<BR>\r
6\r
ecf98fbc 7SPDX-License-Identifier: BSD-2-Clause-Patent\r
4c5a5e0c 8\r
9**/\r
10\r
11#ifndef _ISCSI_DRIVER_H_\r
12#define _ISCSI_DRIVER_H_\r
13\r
14#define ISCSI_V4_PRIVATE_GUID \\r
15 { \\r
16 0xfa3cde4c, 0x87c2, 0x427d, { 0xae, 0xde, 0x7d, 0xd0, 0x96, 0xc8, 0x8c, 0x58 } \\r
17 }\r
18\r
19#define ISCSI_V6_PRIVATE_GUID \\r
20 { \\r
21 0x28be27e5, 0x66cc, 0x4a31, { 0xa3, 0x15, 0xdb, 0x14, 0xc3, 0x74, 0x4d, 0x85 } \\r
22 }\r
23\r
d1050b9d 24#define ISCSI_INITIATOR_NAME_VAR_NAME L"I_NAME"\r
4c5a5e0c 25\r
d1050b9d
MK
26#define IP_MODE_AUTOCONFIG_IP4 3\r
27#define IP_MODE_AUTOCONFIG_IP6 4\r
483ee515 28#define ALWAYS_USE_UEFI_ISCSI_AND_IGNORE_ISCSI_HBA 0x00\r
29#define STOP_UEFI_ISCSI_IF_HBA_INSTALL_AIP 0x01\r
30#define STOP_UEFI_ISCSI_IF_AIP_SUPPORT_IP4 0x02\r
31#define STOP_UEFI_ISCSI_IF_AIP_SUPPORT_IP6 0x04\r
32#define STOP_UEFI_ISCSI_IF_AIP_SUPPORT_OFFLOAD 0x08\r
33#define STOP_UEFI_ISCSI_IF_AIP_SUPPORT_MPIO 0x10\r
34#define STOP_UEFI_ISCSI_IF_AIP_CONFIGURED_IP4 0x20\r
35#define STOP_UEFI_ISCSI_IF_AIP_CONFIGURED_IP6 0x40\r
36#define ALWAYS_USE_ISCSI_HBA_AND_IGNORE_UEFI_ISCSI 0xFF\r
4c5a5e0c 37\r
38extern EFI_COMPONENT_NAME2_PROTOCOL gIScsiComponentName2;\r
39extern EFI_COMPONENT_NAME_PROTOCOL gIScsiComponentName;\r
216f7970 40extern EFI_UNICODE_STRING_TABLE *gIScsiControllerNameTable;\r
4c5a5e0c 41extern EFI_ISCSI_INITIATOR_NAME_PROTOCOL gIScsiInitiatorName;\r
42extern EFI_AUTHENTICATION_INFO_PROTOCOL gIScsiAuthenticationInfo;\r
43extern EFI_EXT_SCSI_PASS_THRU_PROTOCOL gIScsiExtScsiPassThruProtocolTemplate;\r
216f7970 44extern EFI_GUID gIScsiV4PrivateGuid;\r
45extern EFI_GUID gIScsiV6PrivateGuid;\r
4c5a5e0c 46\r
47typedef struct {\r
d1050b9d
MK
48 CHAR16 PortString[ISCSI_NAME_IFR_MAX_SIZE];\r
49 LIST_ENTRY NicInfoList;\r
50 UINT8 NicCount;\r
51 UINT8 CurrentNic;\r
52 UINT8 MaxNic;\r
53 BOOLEAN Ipv6Flag;\r
54 BOOLEAN OneSessionEstablished;\r
55 BOOLEAN EnableMpio;\r
56 UINT8 MpioCount; // The number of attempts in MPIO.\r
57 UINT8 Krb5MpioCount; // The number of attempts login with KRB5 in MPIO.\r
58 UINT8 SinglePathCount; // The number of single path attempts.\r
59 UINT8 ValidSinglePathCount; // The number of valid single path attempts.\r
60 UINT8 BootSelectedIndex;\r
61 UINT8 AttemptCount;\r
62 LIST_ENTRY AttemptConfigs; // User configured Attempt list.\r
63 CHAR8 InitiatorName[ISCSI_NAME_MAX_SIZE];\r
64 UINTN InitiatorNameLength;\r
4c5a5e0c 65} ISCSI_PRIVATE_DATA;\r
66\r
d1050b9d 67extern ISCSI_PRIVATE_DATA *mPrivate;\r
4c5a5e0c 68\r
69typedef struct {\r
d1050b9d
MK
70 LIST_ENTRY Link;\r
71 UINT32 HwAddressSize;\r
72 EFI_MAC_ADDRESS PermanentAddress;\r
73 UINT8 NicIndex;\r
74 UINT16 VlanId;\r
75 UINTN BusNumber;\r
76 UINTN DeviceNumber;\r
77 UINTN FunctionNumber;\r
78 BOOLEAN Ipv6Available;\r
4c5a5e0c 79} ISCSI_NIC_INFO;\r
80\r
81typedef struct _ISCSI_PRIVATE_PROTOCOL {\r
d1050b9d 82 UINT32 Reserved;\r
4c5a5e0c 83} ISCSI_PRIVATE_PROTOCOL;\r
84\r
85//\r
86// EFI Driver Binding Protocol for iSCSI driver.\r
87//\r
88\r
89/**\r
f75a7f56 90 Tests to see if this driver supports a given controller. If a child device is provided,\r
4c5a5e0c 91 it tests to see if this driver supports creating a handle for the specified child device.\r
92\r
f75a7f56
LG
93 This function checks to see if the driver specified by This supports the device specified by\r
94 ControllerHandle. Drivers typically use the device path attached to\r
95 ControllerHandle and/or the services from the bus I/O abstraction attached to\r
96 ControllerHandle to determine if the driver supports ControllerHandle. This function\r
97 may be called many times during platform initialization. In order to reduce boot times, the tests\r
98 performed by this function must be very small and take as little time as possible to execute. This\r
99 function must not change the state of any hardware devices, and this function must be aware that the\r
100 device specified by ControllerHandle may already be managed by the same driver or a\r
101 different driver. This function must match its calls to AllocatePages() with FreePages(),\r
102 AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().\r
103 Since ControllerHandle may have been previously started by the same driver, if a protocol is\r
104 already in the opened state, then it must not be closed with CloseProtocol(). This is required\r
4c5a5e0c 105 to guarantee the state of ControllerHandle is not modified by this function.\r
106\r
107 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
f75a7f56
LG
108 @param[in] ControllerHandle The handle of the controller to test. This handle\r
109 must support a protocol interface that supplies\r
4c5a5e0c 110 an I/O abstraction to the driver.\r
f75a7f56
LG
111 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r
112 parameter is ignored by device drivers, and is optional for bus\r
113 drivers. For bus drivers, if this parameter is not NULL, then\r
114 the bus driver must determine if the bus controller specified\r
115 by ControllerHandle and the child controller specified\r
116 by RemainingDevicePath are both supported by this\r
4c5a5e0c 117 bus driver.\r
118\r
119 @retval EFI_SUCCESS The device specified by ControllerHandle and\r
120 RemainingDevicePath is supported by the driver specified by This.\r
121 @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and\r
122 RemainingDevicePath is already managed by the driver\r
123 specified by This.\r
124 @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and\r
125 RemainingDevicePath is already managed by a different\r
126 driver or an application that requires exclusive access.\r
127 Currently not implemented.\r
128 @retval EFI_UNSUPPORTED The device specified by ControllerHandle and\r
129 RemainingDevicePath is not supported by the driver specified by This.\r
130**/\r
131EFI_STATUS\r
132EFIAPI\r
6879581d 133IScsiIp4DriverBindingSupported (\r
4c5a5e0c 134 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
135 IN EFI_HANDLE ControllerHandle,\r
136 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
137 );\r
138\r
139/**\r
140 Starts a device controller or a bus controller.\r
141\r
142 The Start() function is designed to be invoked from the EFI boot service ConnectController().\r
f75a7f56
LG
143 As a result, much of the error checking on the parameters to Start() has been moved into this\r
144 common boot service. It is legal to call Start() from other locations,\r
4c5a5e0c 145 but the following calling restrictions must be followed or the system behavior will not be deterministic.\r
146 1. ControllerHandle must be a valid EFI_HANDLE.\r
147 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned\r
148 EFI_DEVICE_PATH_PROTOCOL.\r
149 3. Prior to calling Start(), the Supported() function for the driver specified by This must\r
f75a7f56 150 have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.\r
4c5a5e0c 151\r
152 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
f75a7f56
LG
153 @param[in] ControllerHandle The handle of the controller to start. This handle\r
154 must support a protocol interface that supplies\r
4c5a5e0c 155 an I/O abstraction to the driver.\r
f75a7f56
LG
156 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r
157 parameter is ignored by device drivers, and is optional for bus\r
158 drivers. For a bus driver, if this parameter is NULL, then handles\r
159 for all the children of Controller are created by this driver.\r
160 If this parameter is not NULL and the first Device Path Node is\r
161 not the End of Device Path Node, then only the handle for the\r
162 child device specified by the first Device Path Node of\r
4c5a5e0c 163 RemainingDevicePath is created by this driver.\r
f75a7f56 164 If the first Device Path Node of RemainingDevicePath is\r
4c5a5e0c 165 the End of Device Path Node, no child handle is created by this\r
166 driver.\r
167\r
168 @retval EFI_SUCCESS The device was started.\r
169 @retval EFI_DEVICE_ERROR The device could not be started due to a device error. Currently not implemented.\r
170 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
171 @retval Others The driver failed to start the device.\r
172\r
173**/\r
174EFI_STATUS\r
175EFIAPI\r
6879581d 176IScsiIp4DriverBindingStart (\r
4c5a5e0c 177 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
178 IN EFI_HANDLE ControllerHandle,\r
179 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
180 );\r
181\r
182/**\r
183 Stops a device controller or a bus controller.\r
f75a7f56
LG
184\r
185 The Stop() function is designed to be invoked from the EFI boot service DisconnectController().\r
186 As a result, much of the error checking on the parameters to Stop() has been moved\r
187 into this common boot service. It is legal to call Stop() from other locations,\r
4c5a5e0c 188 but the following calling restrictions must be followed or the system behavior will not be deterministic.\r
189 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r
190 same driver's Start() function.\r
191 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid\r
192 EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r
193 Start() function, and the Start() function must have called OpenProtocol() on\r
194 ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
f75a7f56 195\r
4c5a5e0c 196 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
f75a7f56
LG
197 @param[in] ControllerHandle A handle to the device being stopped. The handle must\r
198 support a bus specific I/O protocol for the driver\r
4c5a5e0c 199 to use to stop the device.\r
200 @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.\r
f75a7f56 201 @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL\r
4c5a5e0c 202 if NumberOfChildren is 0.\r
203\r
204 @retval EFI_SUCCESS The device was stopped.\r
205 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.\r
206\r
207**/\r
208EFI_STATUS\r
209EFIAPI\r
6879581d 210IScsiIp4DriverBindingStop (\r
211 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
212 IN EFI_HANDLE ControllerHandle,\r
213 IN UINTN NumberOfChildren,\r
214 IN EFI_HANDLE *ChildHandleBuffer OPTIONAL\r
215 );\r
216\r
217/**\r
f75a7f56 218 Tests to see if this driver supports a given controller. If a child device is provided,\r
6879581d 219 it tests to see if this driver supports creating a handle for the specified child device.\r
220\r
f75a7f56
LG
221 This function checks to see if the driver specified by This supports the device specified by\r
222 ControllerHandle. Drivers typically use the device path attached to\r
223 ControllerHandle and/or the services from the bus I/O abstraction attached to\r
224 ControllerHandle to determine if the driver supports ControllerHandle. This function\r
225 may be called many times during platform initialization. In order to reduce boot times, the tests\r
226 performed by this function must be very small and take as little time as possible to execute. This\r
227 function must not change the state of any hardware devices, and this function must be aware that the\r
228 device specified by ControllerHandle may already be managed by the same driver or a\r
229 different driver. This function must match its calls to AllocatePages() with FreePages(),\r
230 AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().\r
231 Since ControllerHandle may have been previously started by the same driver, if a protocol is\r
232 already in the opened state, then it must not be closed with CloseProtocol(). This is required\r
6879581d 233 to guarantee the state of ControllerHandle is not modified by this function.\r
234\r
235 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
f75a7f56
LG
236 @param[in] ControllerHandle The handle of the controller to test. This handle\r
237 must support a protocol interface that supplies\r
6879581d 238 an I/O abstraction to the driver.\r
f75a7f56
LG
239 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r
240 parameter is ignored by device drivers, and is optional for bus\r
241 drivers. For bus drivers, if this parameter is not NULL, then\r
242 the bus driver must determine if the bus controller specified\r
243 by ControllerHandle and the child controller specified\r
244 by RemainingDevicePath are both supported by this\r
6879581d 245 bus driver.\r
246\r
247 @retval EFI_SUCCESS The device specified by ControllerHandle and\r
248 RemainingDevicePath is supported by the driver specified by This.\r
249 @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and\r
250 RemainingDevicePath is already managed by the driver\r
251 specified by This.\r
252 @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and\r
253 RemainingDevicePath is already managed by a different\r
254 driver or an application that requires exclusive access.\r
255 Currently not implemented.\r
256 @retval EFI_UNSUPPORTED The device specified by ControllerHandle and\r
257 RemainingDevicePath is not supported by the driver specified by This.\r
258**/\r
259EFI_STATUS\r
260EFIAPI\r
261IScsiIp6DriverBindingSupported (\r
262 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
263 IN EFI_HANDLE ControllerHandle,\r
264 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
265 );\r
266\r
267/**\r
268 Starts a device controller or a bus controller.\r
269\r
270 The Start() function is designed to be invoked from the EFI boot service ConnectController().\r
f75a7f56
LG
271 As a result, much of the error checking on the parameters to Start() has been moved into this\r
272 common boot service. It is legal to call Start() from other locations,\r
6879581d 273 but the following calling restrictions must be followed or the system behavior will not be deterministic.\r
274 1. ControllerHandle must be a valid EFI_HANDLE.\r
275 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned\r
276 EFI_DEVICE_PATH_PROTOCOL.\r
277 3. Prior to calling Start(), the Supported() function for the driver specified by This must\r
f75a7f56 278 have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.\r
6879581d 279\r
280 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
f75a7f56
LG
281 @param[in] ControllerHandle The handle of the controller to start. This handle\r
282 must support a protocol interface that supplies\r
6879581d 283 an I/O abstraction to the driver.\r
f75a7f56
LG
284 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r
285 parameter is ignored by device drivers, and is optional for bus\r
286 drivers. For a bus driver, if this parameter is NULL, then handles\r
287 for all the children of Controller are created by this driver.\r
288 If this parameter is not NULL and the first Device Path Node is\r
289 not the End of Device Path Node, then only the handle for the\r
290 child device specified by the first Device Path Node of\r
6879581d 291 RemainingDevicePath is created by this driver.\r
f75a7f56 292 If the first Device Path Node of RemainingDevicePath is\r
6879581d 293 the End of Device Path Node, no child handle is created by this\r
294 driver.\r
295\r
296 @retval EFI_SUCCESS The device was started.\r
297 @retval EFI_DEVICE_ERROR The device could not be started due to a device error. Currently not implemented.\r
298 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
299 @retval Others The driver failed to start the device.\r
300\r
301**/\r
302EFI_STATUS\r
303EFIAPI\r
304IScsiIp6DriverBindingStart (\r
305 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
306 IN EFI_HANDLE ControllerHandle,\r
307 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
308 );\r
309\r
310/**\r
311 Stops a device controller or a bus controller.\r
f75a7f56
LG
312\r
313 The Stop() function is designed to be invoked from the EFI boot service DisconnectController().\r
314 As a result, much of the error checking on the parameters to Stop() has been moved\r
315 into this common boot service. It is legal to call Stop() from other locations,\r
6879581d 316 but the following calling restrictions must be followed or the system behavior will not be deterministic.\r
317 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r
318 same driver's Start() function.\r
319 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid\r
320 EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r
321 Start() function, and the Start() function must have called OpenProtocol() on\r
322 ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
f75a7f56 323\r
6879581d 324 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
f75a7f56
LG
325 @param[in] ControllerHandle A handle to the device being stopped. The handle must\r
326 support a bus specific I/O protocol for the driver\r
6879581d 327 to use to stop the device.\r
328 @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.\r
f75a7f56 329 @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL\r
6879581d 330 if NumberOfChildren is 0.\r
331\r
332 @retval EFI_SUCCESS The device was stopped.\r
333 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.\r
334\r
335**/\r
336EFI_STATUS\r
337EFIAPI\r
338IScsiIp6DriverBindingStop (\r
4c5a5e0c 339 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
340 IN EFI_HANDLE ControllerHandle,\r
341 IN UINTN NumberOfChildren,\r
342 IN EFI_HANDLE *ChildHandleBuffer OPTIONAL\r
343 );\r
344\r
345//\r
346// EFI Component Name(2) Protocol for iSCSI driver.\r
347//\r
348\r
349/**\r
350 Retrieves a Unicode string that is the user readable name of the driver.\r
351\r
352 This function retrieves the user readable name of a driver in the form of a\r
353 Unicode string. If the driver specified by This has a user readable name in\r
354 the language specified by Language, then a pointer to the driver name is\r
355 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
356 by This does not support the language specified by Language,\r
357 then EFI_UNSUPPORTED is returned.\r
358\r
359 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
360 EFI_COMPONENT_NAME_PROTOCOL instance.\r
361\r
362 @param[in] Language A pointer to a Null-terminated ASCII string\r
363 array indicating the language. This is the\r
364 language of the driver name that the caller is\r
365 requesting, and it must match one of the\r
366 languages specified in SupportedLanguages. The\r
367 number of languages supported by a driver is up\r
368 to the driver writer. Language is specified\r
369 in RFC 4646 or ISO 639-2 language code format.\r
370\r
371 @param[out] DriverName A pointer to the Unicode string to return.\r
372 This Unicode string is the name of the\r
373 driver specified by This in the language\r
374 specified by Language.\r
375\r
376 @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
377 This and the language specified by Language was\r
378 returned in DriverName.\r
379\r
380 @retval EFI_INVALID_PARAMETER Language is NULL.\r
381\r
382 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
383\r
384 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
385 the language specified by Language.\r
386\r
387**/\r
388EFI_STATUS\r
389EFIAPI\r
390IScsiComponentNameGetDriverName (\r
d1050b9d
MK
391 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
392 IN CHAR8 *Language,\r
393 OUT CHAR16 **DriverName\r
4c5a5e0c 394 );\r
395\r
396/**\r
397 Retrieves a Unicode string that is the user readable name of the controller\r
398 that is being managed by a driver.\r
399\r
400 This function retrieves the user readable name of the controller specified by\r
401 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
402 driver specified by This has a user readable name in the language specified by\r
403 Language, then a pointer to the controller name is returned in ControllerName,\r
404 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
405 managing the controller specified by ControllerHandle and ChildHandle,\r
406 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
407 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
408\r
409 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
410 EFI_COMPONENT_NAME_PROTOCOL instance.\r
411\r
412 @param[in] ControllerHandle The handle of a controller that the driver\r
413 specified by This is managing. This handle\r
414 specifies the controller whose name is to be\r
415 returned.\r
416\r
417 @param[in] ChildHandle The handle of the child controller to retrieve\r
418 the name of. This is an optional parameter that\r
419 may be NULL. It will be NULL for device\r
420 drivers. It will also be NULL for a bus drivers\r
421 that wish to retrieve the name of the bus\r
422 controller. It will not be NULL for a bus\r
423 driver that wishes to retrieve the name of a\r
424 child controller.\r
425\r
426 @param[in] Language A pointer to a Null-terminated ASCII string\r
427 array indicating the language. This is the\r
428 language of the driver name that the caller is\r
429 requesting, and it must match one of the\r
430 languages specified in SupportedLanguages. The\r
f75a7f56
LG
431 number of languages supported by a driver is\r
432 determined by the driver writer. Language is\r
433 specified inRFC 4646 or ISO 639-2 language code\r
4c5a5e0c 434 format.\r
f75a7f56 435\r
4c5a5e0c 436 @param[out] ControllerName A pointer to the Unicode string to return.\r
437 This Unicode string is the name of the\r
438 controller specified by ControllerHandle and\r
439 ChildHandle in the language specified by\r
440 Language from the point of view of the driver\r
441 specified by This.\r
442\r
443 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
444 the language specified by Language for the\r
445 driver specified by This was returned in\r
446 DriverName.\r
447\r
448 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
449\r
450 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
451 EFI_HANDLE.\r
452\r
453 @retval EFI_INVALID_PARAMETER Language is NULL.\r
454\r
455 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
456\r
457 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
458 managing the controller specified by\r
459 ControllerHandle and ChildHandle.\r
460\r
461 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
462 the language specified by Language.\r
463\r
464**/\r
465EFI_STATUS\r
466EFIAPI\r
467IScsiComponentNameGetControllerName (\r
d1050b9d
MK
468 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
469 IN EFI_HANDLE ControllerHandle,\r
470 IN EFI_HANDLE ChildHandle OPTIONAL,\r
471 IN CHAR8 *Language,\r
472 OUT CHAR16 **ControllerName\r
4c5a5e0c 473 );\r
474\r
475//\r
476// EFI iSCSI Initiator Name Protocol for iSCSI driver.\r
477//\r
478\r
479/**\r
480 Retrieves the current set value of iSCSI Initiator Name.\r
481\r
482 @param[in] This Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL\r
483 instance.\r
484 @param[in, out] BufferSize Size of the buffer in bytes pointed to by Buffer /\r
485 Actual size of the variable data buffer.\r
486 @param[out] Buffer Pointer to the buffer for data to be read.\r
487\r
488 @retval EFI_SUCCESS Data was successfully retrieved into the provided\r
489 buffer and the BufferSize was sufficient to handle\r
490 the iSCSI initiator name.\r
491 @retval EFI_BUFFER_TOO_SMALL BufferSize is too small for the result. BufferSize\r
492 will be updated with the size required to complete\r
493 the request. Buffer will not be affected.\r
494 @retval EFI_INVALID_PARAMETER BufferSize is NULL. BufferSize and Buffer will not\r
495 be affected.\r
496 @retval EFI_INVALID_PARAMETER Buffer is NULL. BufferSize and Buffer will not be\r
497 affected.\r
498 @retval EFI_DEVICE_ERROR The iSCSI initiator name could not be retrieved\r
499 due to a hardware error.\r
500\r
501**/\r
502EFI_STATUS\r
503EFIAPI\r
504IScsiGetInitiatorName (\r
505 IN EFI_ISCSI_INITIATOR_NAME_PROTOCOL *This,\r
506 IN OUT UINTN *BufferSize,\r
507 OUT VOID *Buffer\r
508 );\r
509\r
510/**\r
511 Sets the iSSI Initiator Name.\r
512\r
513 @param[in] This Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL\r
514 instance.\r
515 @param[in, out] BufferSize Size of the buffer in bytes pointed to by Buffer.\r
516 @param[in] Buffer Pointer to the buffer for data to be written.\r
517\r
518 @retval EFI_SUCCESS Data was successfully stored by the protocol.\r
519 @retval EFI_UNSUPPORTED Platform policies do not allow for data to be\r
520 written.\r
521 @retval EFI_INVALID_PARAMETER BufferSize exceeds the maximum allowed limit.\r
522 BufferSize will be updated with the maximum size\r
523 required to complete the request.\r
524 @retval EFI_INVALID_PARAMETER Buffersize is NULL. BufferSize and Buffer will not\r
525 be affected.\r
526 @retval EFI_INVALID_PARAMETER Buffer is NULL. BufferSize and Buffer will not be\r
527 affected.\r
528 @retval EFI_DEVICE_ERROR The data could not be stored due to a hardware\r
529 error.\r
530 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the data\r
531 @retval EFI_PROTOCOL_ERROR Input iSCSI initiator name does not adhere to RFC\r
532 3720\r
533\r
534**/\r
535EFI_STATUS\r
536EFIAPI\r
537IScsiSetInitiatorName (\r
538 IN EFI_ISCSI_INITIATOR_NAME_PROTOCOL *This,\r
539 IN OUT UINTN *BufferSize,\r
540 IN VOID *Buffer\r
541 );\r
542\r
543//\r
544// EFI_AUTHENTICATION_INFO_PROTOCOL for iSCSI driver.\r
545//\r
546\r
547/**\r
548 Retrieves the authentication information associated with a particular controller handle.\r
549\r
550 @param[in] This Pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL.\r
551 @param[in] ControllerHandle Handle to the Controller.\r
552 @param[out] Buffer Pointer to the authentication information. This function is\r
553 responsible for allocating the buffer and it is the caller's\r
554 responsibility to free buffer when the caller is finished with buffer.\r
555\r
556 @retval EFI_DEVICE_ERROR The authentication information could not be\r
557 retrieved due to a hardware error.\r
558\r
559**/\r
560EFI_STATUS\r
561EFIAPI\r
562IScsiGetAuthenticationInfo (\r
d1050b9d
MK
563 IN EFI_AUTHENTICATION_INFO_PROTOCOL *This,\r
564 IN EFI_HANDLE ControllerHandle,\r
565 OUT VOID **Buffer\r
4c5a5e0c 566 );\r
567\r
568/**\r
569 Set the authentication information for a given controller handle.\r
570\r
571 @param[in] This Pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL.\r
572 @param[in] ControllerHandle Handle to the Controller.\r
573 @param[in] Buffer Pointer to the authentication information.\r
574\r
575 @retval EFI_UNSUPPORTED If the platform policies do not allow setting of\r
576 the authentication information.\r
577\r
578**/\r
579EFI_STATUS\r
580EFIAPI\r
581IScsiSetAuthenticationInfo (\r
582 IN EFI_AUTHENTICATION_INFO_PROTOCOL *This,\r
583 IN EFI_HANDLE ControllerHandle,\r
584 IN VOID *Buffer\r
585 );\r
586\r
587//\r
588// EFI_EXT_SCSI_PASS_THRU_PROTOCOL for iSCSI driver.\r
589//\r
590\r
591/**\r
592 Sends a SCSI Request Packet to a SCSI device that is attached to the SCSI channel.\r
593 This function supports both blocking I/O and nonblocking I/O. The blocking I/O\r
f75a7f56 594 functionality is required, and the nonblocking I/O functionality is optional.\r
4c5a5e0c 595\r
596 @param[in] This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
597 @param[in] Target The Target is an array of size TARGET_MAX_BYTES and it\r
598 represents the id of the SCSI device to send the SCSI\r
599 Request Packet. Each transport driver may choose to\r
600 utilize a subset of this size to suit the needs\r
f75a7f56 601 of transport target representation. For example, a\r
4c5a5e0c 602 Fibre Channel driver may use only 8 bytes (WWN)\r
603 to represent an FC target.\r
604 @param[in] Lun The LUN of the SCSI device to send the SCSI Request Packet.\r
605 @param[in, out] Packet A pointer to the SCSI Request Packet to send to the\r
f75a7f56 606 SCSI device specified by Target and Lun.\r
4c5a5e0c 607 @param[in] Event If nonblocking I/O is not supported then Event is ignored,\r
608 and blocking I/O is performed. If Event is NULL, then\r
609 blocking I/O is performed. If Event is not NULL and non\r
610 blocking I/O is supported, then nonblocking I/O is performed,\r
611 and Event will be signaled when the SCSI Request Packet\r
612 completes.\r
613\r
614 @retval EFI_SUCCESS The SCSI Request Packet was sent by the host. For\r
f75a7f56 615 bi-directional commands, InTransferLength bytes\r
4c5a5e0c 616 were transferred from InDataBuffer.\r
617 For write and bi-directional commands, OutTransferLength\r
618 bytes were transferred by OutDataBuffer.\r
619 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was not executed.\r
620 The number of bytes that could be transferred is\r
621 returned in InTransferLength. For write and\r
622 bi-directional commands, OutTransferLength bytes\r
623 were transferred by OutDataBuffer.\r
624 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r
625 there are too many SCSI Request Packets already\r
626 queued. The caller may retry later.\r
627 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send\r
f75a7f56 628 the SCSI Request Packet.\r
4c5a5e0c 629 @retval EFI_INVALID_PARAMETER Target, Lun, or the contents of ScsiRequestPacket\r
630 are invalid.\r
631 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r
632 is not supported by the host adapter.\r
633 This includes the case of Bi-directional SCSI\r
634 commands not supported by the implementation.\r
635 The SCSI Request Packet was not sent,\r
636 so no additional status information is available.\r
637 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI\r
638 Request Packet to execute.\r
639\r
640**/\r
641EFI_STATUS\r
642EFIAPI\r
643IScsiExtScsiPassThruFunction (\r
d1050b9d
MK
644 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,\r
645 IN UINT8 *Target,\r
646 IN UINT64 Lun,\r
647 IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet,\r
648 IN EFI_EVENT Event OPTIONAL\r
4c5a5e0c 649 );\r
650\r
651/**\r
652 Used to retrieve the list of legal Target IDs and LUNs for SCSI devices on\r
653 a SCSI channel. These can either be the list SCSI devices that are actually\r
654 present on the SCSI channel, or the list of legal Target Ids and LUNs for the\r
f75a7f56
LG
655 SCSI channel. Regardless, the caller of this function must probe the Target ID\r
656 and LUN returned to see if a SCSI device is actually present at that location\r
657 on the SCSI channel.\r
4c5a5e0c 658\r
659 @param[in] This The EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
660 @param[in, out] Target On input, a pointer to the Target ID of a SCSI\r
661 device present on the SCSI channel. On output, a\r
662 pointer to the Target ID of the next SCSI device\r
663 present on a SCSI channel. An input value of\r
664 0xFFFFFFFF retrieves the Target ID of the first\r
665 SCSI device present on a SCSI channel.\r
666 @param[in, out] Lun On input, a pointer to the LUN of a SCSI device\r
667 present on the SCSI channel. On output, a pointer\r
668 to the LUN of the next SCSI device present on a\r
669 SCSI channel.\r
670\r
671 @retval EFI_SUCCESS The Target ID and Lun of the next SCSI device on\r
672 the SCSI channel was returned in Target and Lun.\r
673 @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI\r
674 channel.\r
675 @retval EFI_INVALID_PARAMETER Target is not 0xFFFFFFFF,and Target and Lun were\r
676 not returned on a previous call to\r
677 GetNextDevice().\r
678\r
679**/\r
680EFI_STATUS\r
681EFIAPI\r
682IScsiExtScsiPassThruGetNextTargetLun (\r
683 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,\r
684 IN OUT UINT8 **Target,\r
685 IN OUT UINT64 *Lun\r
686 );\r
687\r
688/**\r
689 Allocate and build a device path node for a SCSI device on a SCSI channel.\r
690\r
691 @param[in] This Protocol instance pointer.\r
692 @param[in] Target The Target ID of the SCSI device for which a\r
693 device path node is to be allocated and built.\r
694 @param[in] Lun The LUN of the SCSI device for which a device\r
695 path node is to be allocated and built.\r
696 @param[in, out] DevicePath A pointer to a single device path node that\r
697 describes the SCSI device specified by Target and\r
698 Lun. This function is responsible for allocating\r
699 the buffer DevicePath with the boot service\r
700 AllocatePool(). It is the caller's\r
701 responsibility to free DevicePath when the caller\r
702 is finished with DevicePath.\r
703\r
704 @retval EFI_SUCCESS The device path node that describes the SCSI\r
705 device specified by Target and Lun was allocated\r
706 and returned in DevicePath.\r
707 @retval EFI_NOT_FOUND The SCSI devices specified by Target and Lun does\r
708 not exist on the SCSI channel.\r
709 @retval EFI_INVALID_PARAMETER DevicePath is NULL.\r
710 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate\r
711 DevicePath.\r
712\r
713**/\r
714EFI_STATUS\r
715EFIAPI\r
716IScsiExtScsiPassThruBuildDevicePath (\r
717 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,\r
718 IN UINT8 *Target,\r
719 IN UINT64 Lun,\r
720 IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath\r
721 );\r
722\r
723/**\r
724 Translate a device path node to a Target ID and LUN.\r
725\r
726 @param[in] This Protocol instance pointer.\r
727 @param[in] DevicePath A pointer to the device path node that describes\r
728 a SCSI device on the SCSI channel.\r
729 @param[out] Target A pointer to the Target ID of a SCSI device on\r
730 the SCSI channel.\r
731 @param[out] Lun A pointer to the LUN of a SCSI device on the SCSI\r
732 channel.\r
733\r
734 @retval EFI_SUCCESS DevicePath was successfully translated to a\r
735 Target ID and LUN, and they were returned in\r
736 Target and Lun.\r
737 @retval EFI_INVALID_PARAMETER DevicePath/Target/Lun is NULL.\r
738 @retval EFI_UNSUPPORTED This driver does not support the device path node\r
739 type in DevicePath.\r
740 @retval EFI_NOT_FOUND A valid translation from DevicePath to a Target\r
741 ID and LUN does not exist.\r
742\r
743**/\r
744EFI_STATUS\r
745EFIAPI\r
746IScsiExtScsiPassThruGetTargetLun (\r
747 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,\r
748 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
749 OUT UINT8 **Target,\r
750 OUT UINT64 *Lun\r
751 );\r
752\r
753/**\r
754 Resets a SCSI channel.This operation resets all the SCSI devices connected to\r
755 the SCSI channel.\r
756\r
757 @param[in] This Protocol instance pointer.\r
758\r
759 @retval EFI_UNSUPPORTED It is not supported.\r
760\r
761**/\r
762EFI_STATUS\r
763EFIAPI\r
764IScsiExtScsiPassThruResetChannel (\r
765 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This\r
766 );\r
767\r
768/**\r
769 Resets a SCSI device that is connected to a SCSI channel.\r
770\r
771 @param[in] This Protocol instance pointer.\r
772 @param[in] Target The Target ID of the SCSI device to reset.\r
773 @param[in] Lun The LUN of the SCSI device to reset.\r
774\r
775 @retval EFI_UNSUPPORTED It is not supported.\r
776\r
777**/\r
778EFI_STATUS\r
779EFIAPI\r
780IScsiExtScsiPassThruResetTargetLun (\r
781 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,\r
782 IN UINT8 *Target,\r
783 IN UINT64 Lun\r
784 );\r
785\r
786/**\r
f75a7f56 787 Retrieve the list of legal Target IDs for SCSI devices on a SCSI channel.\r
4c5a5e0c 788\r
789 @param[in] This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL\r
790 instance.\r
791 @param[in, out] Target (TARGET_MAX_BYTES) of a SCSI device present on\r
792 the SCSI channel. On output, a pointer to the\r
793 Target ID (an array of TARGET_MAX_BYTES) of the\r
794 next SCSI device present on a SCSI channel.\r
795 An input value of 0xF(all bytes in the array are 0xF)\r
796 in the Target array retrieves the Target ID of the\r
f75a7f56 797 first SCSI device present on a SCSI channel.\r
4c5a5e0c 798\r
799 @retval EFI_SUCCESS The Target ID of the next SCSI device on the SCSI\r
800 channel was returned in Target.\r
801 @retval EFI_INVALID_PARAMETER Target or Lun is NULL.\r
802 @retval EFI_TIMEOUT Target array is not all 0xF, and Target was not\r
803 returned on a previous call to GetNextTarget().\r
804 @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.\r
805\r
806**/\r
807EFI_STATUS\r
808EFIAPI\r
809IScsiExtScsiPassThruGetNextTarget (\r
810 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,\r
811 IN OUT UINT8 **Target\r
812 );\r
813\r
814#endif\r