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