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