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