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