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