2 The header file of IScsiDriver.c.
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
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.
15 #ifndef _ISCSI_DRIVER_H_
16 #define _ISCSI_DRIVER_H_
18 #define ISCSI_V4_PRIVATE_GUID \
20 0xfa3cde4c, 0x87c2, 0x427d, { 0xae, 0xde, 0x7d, 0xd0, 0x96, 0xc8, 0x8c, 0x58 } \
23 #define ISCSI_V6_PRIVATE_GUID \
25 0x28be27e5, 0x66cc, 0x4a31, { 0xa3, 0x15, 0xdb, 0x14, 0xc3, 0x74, 0x4d, 0x85 } \
28 #define ISCSI_INITIATOR_NAME_VAR_NAME L"I_NAME"
30 #define IP_MODE_AUTOCONFIG_IP4 3
31 #define IP_MODE_AUTOCONFIG_IP6 4
32 #define ALWAYS_USE_UEFI_ISCSI_AND_IGNORE_AIP 0x00
33 #define STOP_UEFI_ISCSI_IF_HBA_INSTALL_AIP 0x01
34 #define STOP_UEFI_ISCSI_IF_AIP_SUPPORT_IP4 0x02
35 #define STOP_UEFI_ISCSI_IF_AIP_SUPPORT_IP6 0x04
36 #define STOP_UEFI_ISCSI_IF_AIP_SUPPORT_OFFLOAD 0x08
37 #define STOP_UEFI_ISCSI_IF_AIP_SUPPORT_MPIO 0x10
38 #define STOP_UEFI_ISCSI_IF_AIP_CONFIGURED_IP4 0x20
39 #define STOP_UEFI_ISCSI_IF_AIP_CONFIGURED_IP6 0x40
41 extern EFI_COMPONENT_NAME2_PROTOCOL gIScsiComponentName2
;
42 extern EFI_COMPONENT_NAME_PROTOCOL gIScsiComponentName
;
43 extern EFI_UNICODE_STRING_TABLE
*gIScsiControllerNameTable
;
44 extern EFI_ISCSI_INITIATOR_NAME_PROTOCOL gIScsiInitiatorName
;
45 extern EFI_AUTHENTICATION_INFO_PROTOCOL gIScsiAuthenticationInfo
;
46 extern EFI_EXT_SCSI_PASS_THRU_PROTOCOL gIScsiExtScsiPassThruProtocolTemplate
;
47 extern EFI_GUID gIScsiV4PrivateGuid
;
48 extern EFI_GUID gIScsiV6PrivateGuid
;
51 CHAR16 PortString
[ISCSI_NAME_IFR_MAX_SIZE
];
52 LIST_ENTRY NicInfoList
;
57 BOOLEAN OneSessionEstablished
;
59 UINT8 MpioCount
; // The number of attempts in MPIO.
60 UINT8 Krb5MpioCount
; // The number of attempts login with KRB5 in MPIO.
61 UINT8 SinglePathCount
; // The number of single path attempts.
62 UINT8 ValidSinglePathCount
; // The number of valid single path attempts.
63 UINT8 BootSelectedIndex
;
65 LIST_ENTRY AttemptConfigs
; // User configured Attempt list.
66 CHAR8 InitiatorName
[ISCSI_NAME_MAX_SIZE
];
67 UINTN InitiatorNameLength
;
68 VOID
*NewAttempt
; // Attempt is created but not saved.
71 extern ISCSI_PRIVATE_DATA
*mPrivate
;
76 EFI_MAC_ADDRESS PermanentAddress
;
84 typedef struct _ISCSI_PRIVATE_PROTOCOL
{
86 } ISCSI_PRIVATE_PROTOCOL
;
89 // EFI Driver Binding Protocol for iSCSI driver.
93 Tests to see if this driver supports a given controller. If a child device is provided,
94 it tests to see if this driver supports creating a handle for the specified child device.
96 This function checks to see if the driver specified by This supports the device specified by
97 ControllerHandle. Drivers typically use the device path attached to
98 ControllerHandle and/or the services from the bus I/O abstraction attached to
99 ControllerHandle to determine if the driver supports ControllerHandle. This function
100 may be called many times during platform initialization. In order to reduce boot times, the tests
101 performed by this function must be very small and take as little time as possible to execute. This
102 function must not change the state of any hardware devices, and this function must be aware that the
103 device specified by ControllerHandle may already be managed by the same driver or a
104 different driver. This function must match its calls to AllocatePages() with FreePages(),
105 AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
106 Since ControllerHandle may have been previously started by the same driver, if a protocol is
107 already in the opened state, then it must not be closed with CloseProtocol(). This is required
108 to guarantee the state of ControllerHandle is not modified by this function.
110 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
111 @param[in] ControllerHandle The handle of the controller to test. This handle
112 must support a protocol interface that supplies
113 an I/O abstraction to the driver.
114 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
115 parameter is ignored by device drivers, and is optional for bus
116 drivers. For bus drivers, if this parameter is not NULL, then
117 the bus driver must determine if the bus controller specified
118 by ControllerHandle and the child controller specified
119 by RemainingDevicePath are both supported by this
122 @retval EFI_SUCCESS The device specified by ControllerHandle and
123 RemainingDevicePath is supported by the driver specified by This.
124 @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
125 RemainingDevicePath is already managed by the driver
127 @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
128 RemainingDevicePath is already managed by a different
129 driver or an application that requires exclusive access.
130 Currently not implemented.
131 @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
132 RemainingDevicePath is not supported by the driver specified by This.
136 IScsiIp4DriverBindingSupported (
137 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
138 IN EFI_HANDLE ControllerHandle
,
139 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
143 Starts a device controller or a bus controller.
145 The Start() function is designed to be invoked from the EFI boot service ConnectController().
146 As a result, much of the error checking on the parameters to Start() has been moved into this
147 common boot service. It is legal to call Start() from other locations,
148 but the following calling restrictions must be followed or the system behavior will not be deterministic.
149 1. ControllerHandle must be a valid EFI_HANDLE.
150 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
151 EFI_DEVICE_PATH_PROTOCOL.
152 3. Prior to calling Start(), the Supported() function for the driver specified by This must
153 have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
155 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
156 @param[in] ControllerHandle The handle of the controller to start. This handle
157 must support a protocol interface that supplies
158 an I/O abstraction to the driver.
159 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
160 parameter is ignored by device drivers, and is optional for bus
161 drivers. For a bus driver, if this parameter is NULL, then handles
162 for all the children of Controller are created by this driver.
163 If this parameter is not NULL and the first Device Path Node is
164 not the End of Device Path Node, then only the handle for the
165 child device specified by the first Device Path Node of
166 RemainingDevicePath is created by this driver.
167 If the first Device Path Node of RemainingDevicePath is
168 the End of Device Path Node, no child handle is created by this
171 @retval EFI_SUCCESS The device was started.
172 @retval EFI_DEVICE_ERROR The device could not be started due to a device error. Currently not implemented.
173 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
174 @retval Others The driver failed to start the device.
179 IScsiIp4DriverBindingStart (
180 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
181 IN EFI_HANDLE ControllerHandle
,
182 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
186 Stops a device controller or a bus controller.
188 The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
189 As a result, much of the error checking on the parameters to Stop() has been moved
190 into this common boot service. It is legal to call Stop() from other locations,
191 but the following calling restrictions must be followed or the system behavior will not be deterministic.
192 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
193 same driver's Start() function.
194 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
195 EFI_HANDLE. In addition, all of these handles must have been created in this driver's
196 Start() function, and the Start() function must have called OpenProtocol() on
197 ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
199 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
200 @param[in] ControllerHandle A handle to the device being stopped. The handle must
201 support a bus specific I/O protocol for the driver
202 to use to stop the device.
203 @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
204 @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
205 if NumberOfChildren is 0.
207 @retval EFI_SUCCESS The device was stopped.
208 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
213 IScsiIp4DriverBindingStop (
214 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
215 IN EFI_HANDLE ControllerHandle
,
216 IN UINTN NumberOfChildren
,
217 IN EFI_HANDLE
*ChildHandleBuffer OPTIONAL
221 Tests to see if this driver supports a given controller. If a child device is provided,
222 it tests to see if this driver supports creating a handle for the specified child device.
224 This function checks to see if the driver specified by This supports the device specified by
225 ControllerHandle. Drivers typically use the device path attached to
226 ControllerHandle and/or the services from the bus I/O abstraction attached to
227 ControllerHandle to determine if the driver supports ControllerHandle. This function
228 may be called many times during platform initialization. In order to reduce boot times, the tests
229 performed by this function must be very small and take as little time as possible to execute. This
230 function must not change the state of any hardware devices, and this function must be aware that the
231 device specified by ControllerHandle may already be managed by the same driver or a
232 different driver. This function must match its calls to AllocatePages() with FreePages(),
233 AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
234 Since ControllerHandle may have been previously started by the same driver, if a protocol is
235 already in the opened state, then it must not be closed with CloseProtocol(). This is required
236 to guarantee the state of ControllerHandle is not modified by this function.
238 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
239 @param[in] ControllerHandle The handle of the controller to test. This handle
240 must support a protocol interface that supplies
241 an I/O abstraction to the driver.
242 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
243 parameter is ignored by device drivers, and is optional for bus
244 drivers. For bus drivers, if this parameter is not NULL, then
245 the bus driver must determine if the bus controller specified
246 by ControllerHandle and the child controller specified
247 by RemainingDevicePath are both supported by this
250 @retval EFI_SUCCESS The device specified by ControllerHandle and
251 RemainingDevicePath is supported by the driver specified by This.
252 @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
253 RemainingDevicePath is already managed by the driver
255 @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
256 RemainingDevicePath is already managed by a different
257 driver or an application that requires exclusive access.
258 Currently not implemented.
259 @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
260 RemainingDevicePath is not supported by the driver specified by This.
264 IScsiIp6DriverBindingSupported (
265 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
266 IN EFI_HANDLE ControllerHandle
,
267 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
271 Starts a device controller or a bus controller.
273 The Start() function is designed to be invoked from the EFI boot service ConnectController().
274 As a result, much of the error checking on the parameters to Start() has been moved into this
275 common boot service. It is legal to call Start() from other locations,
276 but the following calling restrictions must be followed or the system behavior will not be deterministic.
277 1. ControllerHandle must be a valid EFI_HANDLE.
278 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
279 EFI_DEVICE_PATH_PROTOCOL.
280 3. Prior to calling Start(), the Supported() function for the driver specified by This must
281 have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
283 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
284 @param[in] ControllerHandle The handle of the controller to start. This handle
285 must support a protocol interface that supplies
286 an I/O abstraction to the driver.
287 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
288 parameter is ignored by device drivers, and is optional for bus
289 drivers. For a bus driver, if this parameter is NULL, then handles
290 for all the children of Controller are created by this driver.
291 If this parameter is not NULL and the first Device Path Node is
292 not the End of Device Path Node, then only the handle for the
293 child device specified by the first Device Path Node of
294 RemainingDevicePath is created by this driver.
295 If the first Device Path Node of RemainingDevicePath is
296 the End of Device Path Node, no child handle is created by this
299 @retval EFI_SUCCESS The device was started.
300 @retval EFI_DEVICE_ERROR The device could not be started due to a device error. Currently not implemented.
301 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
302 @retval Others The driver failed to start the device.
307 IScsiIp6DriverBindingStart (
308 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
309 IN EFI_HANDLE ControllerHandle
,
310 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
314 Stops a device controller or a bus controller.
316 The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
317 As a result, much of the error checking on the parameters to Stop() has been moved
318 into this common boot service. It is legal to call Stop() from other locations,
319 but the following calling restrictions must be followed or the system behavior will not be deterministic.
320 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
321 same driver's Start() function.
322 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
323 EFI_HANDLE. In addition, all of these handles must have been created in this driver's
324 Start() function, and the Start() function must have called OpenProtocol() on
325 ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
327 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
328 @param[in] ControllerHandle A handle to the device being stopped. The handle must
329 support a bus specific I/O protocol for the driver
330 to use to stop the device.
331 @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
332 @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
333 if NumberOfChildren is 0.
335 @retval EFI_SUCCESS The device was stopped.
336 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
341 IScsiIp6DriverBindingStop (
342 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
343 IN EFI_HANDLE ControllerHandle
,
344 IN UINTN NumberOfChildren
,
345 IN EFI_HANDLE
*ChildHandleBuffer OPTIONAL
349 // EFI Component Name(2) Protocol for iSCSI driver.
353 Retrieves a Unicode string that is the user readable name of the driver.
355 This function retrieves the user readable name of a driver in the form of a
356 Unicode string. If the driver specified by This has a user readable name in
357 the language specified by Language, then a pointer to the driver name is
358 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
359 by This does not support the language specified by Language,
360 then EFI_UNSUPPORTED is returned.
362 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
363 EFI_COMPONENT_NAME_PROTOCOL instance.
365 @param[in] Language A pointer to a Null-terminated ASCII string
366 array indicating the language. This is the
367 language of the driver name that the caller is
368 requesting, and it must match one of the
369 languages specified in SupportedLanguages. The
370 number of languages supported by a driver is up
371 to the driver writer. Language is specified
372 in RFC 4646 or ISO 639-2 language code format.
374 @param[out] DriverName A pointer to the Unicode string to return.
375 This Unicode string is the name of the
376 driver specified by This in the language
377 specified by Language.
379 @retval EFI_SUCCESS The Unicode string for the Driver specified by
380 This and the language specified by Language was
381 returned in DriverName.
383 @retval EFI_INVALID_PARAMETER Language is NULL.
385 @retval EFI_INVALID_PARAMETER DriverName is NULL.
387 @retval EFI_UNSUPPORTED The driver specified by This does not support
388 the language specified by Language.
393 IScsiComponentNameGetDriverName (
394 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
396 OUT CHAR16
**DriverName
400 Retrieves a Unicode string that is the user readable name of the controller
401 that is being managed by a driver.
403 This function retrieves the user readable name of the controller specified by
404 ControllerHandle and ChildHandle in the form of a Unicode string. If the
405 driver specified by This has a user readable name in the language specified by
406 Language, then a pointer to the controller name is returned in ControllerName,
407 and EFI_SUCCESS is returned. If the driver specified by This is not currently
408 managing the controller specified by ControllerHandle and ChildHandle,
409 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
410 support the language specified by Language, then EFI_UNSUPPORTED is returned.
412 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
413 EFI_COMPONENT_NAME_PROTOCOL instance.
415 @param[in] ControllerHandle The handle of a controller that the driver
416 specified by This is managing. This handle
417 specifies the controller whose name is to be
420 @param[in] ChildHandle The handle of the child controller to retrieve
421 the name of. This is an optional parameter that
422 may be NULL. It will be NULL for device
423 drivers. It will also be NULL for a bus drivers
424 that wish to retrieve the name of the bus
425 controller. It will not be NULL for a bus
426 driver that wishes to retrieve the name of a
429 @param[in] Language A pointer to a Null-terminated ASCII string
430 array indicating the language. This is the
431 language of the driver name that the caller is
432 requesting, and it must match one of the
433 languages specified in SupportedLanguages. The
434 number of languages supported by a driver is
435 determined by the driver writer. Language is
436 specified inRFC 4646 or ISO 639-2 language code
439 @param[out] ControllerName A pointer to the Unicode string to return.
440 This Unicode string is the name of the
441 controller specified by ControllerHandle and
442 ChildHandle in the language specified by
443 Language from the point of view of the driver
446 @retval EFI_SUCCESS The Unicode string for the user readable name in
447 the language specified by Language for the
448 driver specified by This was returned in
451 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
453 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
456 @retval EFI_INVALID_PARAMETER Language is NULL.
458 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
460 @retval EFI_UNSUPPORTED The driver specified by This is not currently
461 managing the controller specified by
462 ControllerHandle and ChildHandle.
464 @retval EFI_UNSUPPORTED The driver specified by This does not support
465 the language specified by Language.
470 IScsiComponentNameGetControllerName (
471 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
472 IN EFI_HANDLE ControllerHandle
,
473 IN EFI_HANDLE ChildHandle OPTIONAL
,
475 OUT CHAR16
**ControllerName
479 // EFI iSCSI Initiator Name Protocol for iSCSI driver.
483 Retrieves the current set value of iSCSI Initiator Name.
485 @param[in] This Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL
487 @param[in, out] BufferSize Size of the buffer in bytes pointed to by Buffer /
488 Actual size of the variable data buffer.
489 @param[out] Buffer Pointer to the buffer for data to be read.
491 @retval EFI_SUCCESS Data was successfully retrieved into the provided
492 buffer and the BufferSize was sufficient to handle
493 the iSCSI initiator name.
494 @retval EFI_BUFFER_TOO_SMALL BufferSize is too small for the result. BufferSize
495 will be updated with the size required to complete
496 the request. Buffer will not be affected.
497 @retval EFI_INVALID_PARAMETER BufferSize is NULL. BufferSize and Buffer will not
499 @retval EFI_INVALID_PARAMETER Buffer is NULL. BufferSize and Buffer will not be
501 @retval EFI_DEVICE_ERROR The iSCSI initiator name could not be retrieved
502 due to a hardware error.
507 IScsiGetInitiatorName (
508 IN EFI_ISCSI_INITIATOR_NAME_PROTOCOL
*This
,
509 IN OUT UINTN
*BufferSize
,
514 Sets the iSSI Initiator Name.
516 @param[in] This Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL
518 @param[in, out] BufferSize Size of the buffer in bytes pointed to by Buffer.
519 @param[in] Buffer Pointer to the buffer for data to be written.
521 @retval EFI_SUCCESS Data was successfully stored by the protocol.
522 @retval EFI_UNSUPPORTED Platform policies do not allow for data to be
524 @retval EFI_INVALID_PARAMETER BufferSize exceeds the maximum allowed limit.
525 BufferSize will be updated with the maximum size
526 required to complete the request.
527 @retval EFI_INVALID_PARAMETER Buffersize is NULL. BufferSize and Buffer will not
529 @retval EFI_INVALID_PARAMETER Buffer is NULL. BufferSize and Buffer will not be
531 @retval EFI_DEVICE_ERROR The data could not be stored due to a hardware
533 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the data
534 @retval EFI_PROTOCOL_ERROR Input iSCSI initiator name does not adhere to RFC
540 IScsiSetInitiatorName (
541 IN EFI_ISCSI_INITIATOR_NAME_PROTOCOL
*This
,
542 IN OUT UINTN
*BufferSize
,
547 // EFI_AUTHENTICATION_INFO_PROTOCOL for iSCSI driver.
551 Retrieves the authentication information associated with a particular controller handle.
553 @param[in] This Pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL.
554 @param[in] ControllerHandle Handle to the Controller.
555 @param[out] Buffer Pointer to the authentication information. This function is
556 responsible for allocating the buffer and it is the caller's
557 responsibility to free buffer when the caller is finished with buffer.
559 @retval EFI_DEVICE_ERROR The authentication information could not be
560 retrieved due to a hardware error.
565 IScsiGetAuthenticationInfo (
566 IN EFI_AUTHENTICATION_INFO_PROTOCOL
*This
,
567 IN EFI_HANDLE ControllerHandle
,
572 Set the authentication information for a given controller handle.
574 @param[in] This Pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL.
575 @param[in] ControllerHandle Handle to the Controller.
576 @param[in] Buffer Pointer to the authentication information.
578 @retval EFI_UNSUPPORTED If the platform policies do not allow setting of
579 the authentication information.
584 IScsiSetAuthenticationInfo (
585 IN EFI_AUTHENTICATION_INFO_PROTOCOL
*This
,
586 IN EFI_HANDLE ControllerHandle
,
591 // EFI_EXT_SCSI_PASS_THRU_PROTOCOL for iSCSI driver.
595 Sends a SCSI Request Packet to a SCSI device that is attached to the SCSI channel.
596 This function supports both blocking I/O and nonblocking I/O. The blocking I/O
597 functionality is required, and the nonblocking I/O functionality is optional.
599 @param[in] This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
600 @param[in] Target The Target is an array of size TARGET_MAX_BYTES and it
601 represents the id of the SCSI device to send the SCSI
602 Request Packet. Each transport driver may choose to
603 utilize a subset of this size to suit the needs
604 of transport target representation. For example, a
605 Fibre Channel driver may use only 8 bytes (WWN)
606 to represent an FC target.
607 @param[in] Lun The LUN of the SCSI device to send the SCSI Request Packet.
608 @param[in, out] Packet A pointer to the SCSI Request Packet to send to the
609 SCSI device specified by Target and Lun.
610 @param[in] Event If nonblocking I/O is not supported then Event is ignored,
611 and blocking I/O is performed. If Event is NULL, then
612 blocking I/O is performed. If Event is not NULL and non
613 blocking I/O is supported, then nonblocking I/O is performed,
614 and Event will be signaled when the SCSI Request Packet
617 @retval EFI_SUCCESS The SCSI Request Packet was sent by the host. For
618 bi-directional commands, InTransferLength bytes
619 were transferred from InDataBuffer.
620 For write and bi-directional commands, OutTransferLength
621 bytes were transferred by OutDataBuffer.
622 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was not executed.
623 The number of bytes that could be transferred is
624 returned in InTransferLength. For write and
625 bi-directional commands, OutTransferLength bytes
626 were transferred by OutDataBuffer.
627 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because
628 there are too many SCSI Request Packets already
629 queued. The caller may retry later.
630 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send
631 the SCSI Request Packet.
632 @retval EFI_INVALID_PARAMETER Target, Lun, or the contents of ScsiRequestPacket
634 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet
635 is not supported by the host adapter.
636 This includes the case of Bi-directional SCSI
637 commands not supported by the implementation.
638 The SCSI Request Packet was not sent,
639 so no additional status information is available.
640 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI
641 Request Packet to execute.
646 IScsiExtScsiPassThruFunction (
647 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
650 IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET
*Packet
,
651 IN EFI_EVENT Event OPTIONAL
655 Used to retrieve the list of legal Target IDs and LUNs for SCSI devices on
656 a SCSI channel. These can either be the list SCSI devices that are actually
657 present on the SCSI channel, or the list of legal Target Ids and LUNs for the
658 SCSI channel. Regardless, the caller of this function must probe the Target ID
659 and LUN returned to see if a SCSI device is actually present at that location
662 @param[in] This The EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
663 @param[in, out] Target On input, a pointer to the Target ID of a SCSI
664 device present on the SCSI channel. On output, a
665 pointer to the Target ID of the next SCSI device
666 present on a SCSI channel. An input value of
667 0xFFFFFFFF retrieves the Target ID of the first
668 SCSI device present on a SCSI channel.
669 @param[in, out] Lun On input, a pointer to the LUN of a SCSI device
670 present on the SCSI channel. On output, a pointer
671 to the LUN of the next SCSI device present on a
674 @retval EFI_SUCCESS The Target ID and Lun of the next SCSI device on
675 the SCSI channel was returned in Target and Lun.
676 @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI
678 @retval EFI_INVALID_PARAMETER Target is not 0xFFFFFFFF,and Target and Lun were
679 not returned on a previous call to
685 IScsiExtScsiPassThruGetNextTargetLun (
686 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
687 IN OUT UINT8
**Target
,
692 Allocate and build a device path node for a SCSI device on a SCSI channel.
694 @param[in] This Protocol instance pointer.
695 @param[in] Target The Target ID of the SCSI device for which a
696 device path node is to be allocated and built.
697 @param[in] Lun The LUN of the SCSI device for which a device
698 path node is to be allocated and built.
699 @param[in, out] DevicePath A pointer to a single device path node that
700 describes the SCSI device specified by Target and
701 Lun. This function is responsible for allocating
702 the buffer DevicePath with the boot service
703 AllocatePool(). It is the caller's
704 responsibility to free DevicePath when the caller
705 is finished with DevicePath.
707 @retval EFI_SUCCESS The device path node that describes the SCSI
708 device specified by Target and Lun was allocated
709 and returned in DevicePath.
710 @retval EFI_NOT_FOUND The SCSI devices specified by Target and Lun does
711 not exist on the SCSI channel.
712 @retval EFI_INVALID_PARAMETER DevicePath is NULL.
713 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate
719 IScsiExtScsiPassThruBuildDevicePath (
720 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
723 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
727 Translate a device path node to a Target ID and LUN.
729 @param[in] This Protocol instance pointer.
730 @param[in] DevicePath A pointer to the device path node that describes
731 a SCSI device on the SCSI channel.
732 @param[out] Target A pointer to the Target ID of a SCSI device on
734 @param[out] Lun A pointer to the LUN of a SCSI device on the SCSI
737 @retval EFI_SUCCESS DevicePath was successfully translated to a
738 Target ID and LUN, and they were returned in
740 @retval EFI_INVALID_PARAMETER DevicePath/Target/Lun is NULL.
741 @retval EFI_UNSUPPORTED This driver does not support the device path node
743 @retval EFI_NOT_FOUND A valid translation from DevicePath to a Target
744 ID and LUN does not exist.
749 IScsiExtScsiPassThruGetTargetLun (
750 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
751 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
757 Resets a SCSI channel.This operation resets all the SCSI devices connected to
760 @param[in] This Protocol instance pointer.
762 @retval EFI_UNSUPPORTED It is not supported.
767 IScsiExtScsiPassThruResetChannel (
768 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
772 Resets a SCSI device that is connected to a SCSI channel.
774 @param[in] This Protocol instance pointer.
775 @param[in] Target The Target ID of the SCSI device to reset.
776 @param[in] Lun The LUN of the SCSI device to reset.
778 @retval EFI_UNSUPPORTED It is not supported.
783 IScsiExtScsiPassThruResetTargetLun (
784 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
790 Retrieve the list of legal Target IDs for SCSI devices on a SCSI channel.
792 @param[in] This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL
794 @param[in, out] Target (TARGET_MAX_BYTES) of a SCSI device present on
795 the SCSI channel. On output, a pointer to the
796 Target ID (an array of TARGET_MAX_BYTES) of the
797 next SCSI device present on a SCSI channel.
798 An input value of 0xF(all bytes in the array are 0xF)
799 in the Target array retrieves the Target ID of the
800 first SCSI device present on a SCSI channel.
802 @retval EFI_SUCCESS The Target ID of the next SCSI device on the SCSI
803 channel was returned in Target.
804 @retval EFI_INVALID_PARAMETER Target or Lun is NULL.
805 @retval EFI_TIMEOUT Target array is not all 0xF, and Target was not
806 returned on a previous call to GetNextTarget().
807 @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.
812 IScsiExtScsiPassThruGetNextTarget (
813 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
814 IN OUT UINT8
**Target