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