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