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