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