]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.h
Fix a minor GUID format issue.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / IScsiDxe / IScsiDriver.h
1 /** @file
2 The header file of IScsiDriver.c
3
4 Copyright (c) 2004 - 2008, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 Module Name:
14
15 IScsiDriver.h
16
17 Abstract:
18 The header file of IScsiDriver.c
19
20 **/
21
22 #ifndef _ISCSI_DRIVER_H_
23 #define _ISCSI_DRIVER_H_
24
25 #include <PiDxe.h>
26 #include <Protocol/DevicePath.h>
27 #include <Protocol/LoadedImage.h>
28 #include <Library/UefiDriverEntryPoint.h>
29 #include <Library/UefiBootServicesTableLib.h>
30 #include <Library/UefiLib.h>
31 #include <Library/DevicePathLib.h>
32 #include <Protocol/DriverBinding.h>
33 #include <Protocol/ScsiPassThruExt.h>
34 #include <Protocol/IScsiInitiatorName.h>
35 #include <Protocol/Ip4Config.h>
36 #include <Protocol/ComponentName.h>
37 #include <Protocol/ComponentName2.h>
38
39 #define ISCSI_PRIVATE_GUID \
40 { 0xfa3cde4c, 0x87c2, 0x427d, {0xae, 0xde, 0x7d, 0xd0, 0x96, 0xc8, 0x8c, 0x58} }
41
42 #define ISCSI_INITIATOR_NAME_VAR_NAME L"I_NAME"
43
44 extern EFI_COMPONENT_NAME2_PROTOCOL gIScsiComponentName2;
45 extern EFI_COMPONENT_NAME_PROTOCOL gIScsiComponentName;
46
47 extern EFI_ISCSI_INITIATOR_NAME_PROTOCOL gIScsiInitiatorName;
48
49 extern EFI_GUID mIScsiPrivateGuid;
50
51 typedef struct _ISCSI_PRIVATE_PROTOCOL {
52 UINT32 Reserved;
53 } ISCSI_PRIVATE_PROTOCOL;
54
55 //
56 // EFI Driver Binding Protocol for iSCSI driver.
57 //
58 /**
59 Test to see if IScsi driver supports the given controller.
60
61 @param This[in] Protocol instance pointer.
62
63 @param ControllerHandle[in] Handle of controller to test.
64
65 @param RemainingDevicePath[in] Optional parameter use to pick a specific child device to start.
66
67 @retval EFI_SUCCES This driver supports the controller.
68
69 @retval EFI_ALREADY_STARTED This driver is already running on this device.
70
71 @retval EFI_UNSUPPORTED This driver doesn't support the controller.
72
73 **/
74 EFI_STATUS
75 EFIAPI
76 IScsiDriverBindingSupported (
77 IN EFI_DRIVER_BINDING_PROTOCOL *This,
78 IN EFI_HANDLE ControllerHandle,
79 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
80 );
81
82 /**
83 Start to manage the controller.
84
85 @param This[in] Protocol instance pointer.
86
87 @param ControllerHandle[in] Handle of the controller.
88
89 @param RemainingDevicePath[in] Optional parameter use to pick a specific child device to start.
90
91 @retval EFI_SUCCES This driver supports this device.
92
93 @retval EFI_ALREADY_STARTED This driver is already running on this device.
94
95 **/
96 EFI_STATUS
97 EFIAPI
98 IScsiDriverBindingStart (
99 IN EFI_DRIVER_BINDING_PROTOCOL *This,
100 IN EFI_HANDLE ControllerHandle,
101 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
102 );
103
104 /**
105 Release the control of this controller and remove the IScsi functions.
106
107 @param This[in] Protocol instance pointer.
108
109 @param ControllerHandle[in] Handle of controller to stop.
110
111 @param NumberOfChildren[in] Not used.
112
113 @param ChildHandleBuffer[in] Not used.
114
115 @retval EFI_SUCCES This driver supports this device.
116
117 **/
118 EFI_STATUS
119 EFIAPI
120 IScsiDriverBindingStop (
121 IN EFI_DRIVER_BINDING_PROTOCOL *This,
122 IN EFI_HANDLE ControllerHandle,
123 IN UINTN NumberOfChildren,
124 IN EFI_HANDLE *ChildHandleBuffer
125 );
126
127 //
128 // EFI Component Name Protocol for IScsi driver.
129 //
130 /**
131 Retrieves a Unicode string that is the user readable name of the EFI Driver.
132
133 This function retrieves the user readable name of a driver in the form of a
134 Unicode string. If the driver specified by This has a user readable name in
135 the language specified by Language, then a pointer to the driver name is
136 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
137 by This does not support the language specified by Language,
138 then EFI_UNSUPPORTED is returned.
139
140 @param This[in] A pointer to the EFI_COMPONENT_NAME_PROTOCOL
141 instance.
142
143 @param Language[in] A pointer to a three character ISO 639-2 language
144 identifier.
145 This is the language of the driver name that that
146 the caller is requesting, and it must match one of
147 the languages specified in SupportedLanguages.
148 The number of languages supported by a driver is up
149 to the driver writer.
150
151 @param DriverName[out] A pointer to the Unicode string to return.
152 This Unicode string is the name of the
153 driver specified by This in the language
154 specified by Language.
155
156 @retval EFI_SUCCESS The Unicode string for the Driver specified by
157 This and the language specified by Language was
158 returned in DriverName.
159
160 @retval EFI_INVALID_PARAMETER Language is NULL.
161
162 @retval EFI_INVALID_PARAMETER DriverName is NULL.
163
164 @retval EFI_UNSUPPORTED The driver specified by This does not support
165 the language specified by Language.
166
167 **/
168 EFI_STATUS
169 EFIAPI
170 IScsiComponentNameGetDriverName (
171 IN EFI_COMPONENT_NAME_PROTOCOL *This,
172 IN CHAR8 *Language,
173 OUT CHAR16 **DriverName
174 );
175
176 /**
177 Retrieves a Unicode string that is the user readable name of the controller
178 that is being managed by an EFI Driver.
179
180 @param This[in] A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
181
182 @param ControllerHandle[in] The handle of a controller that the driver specified by
183 This is managing. This handle specifies the controller
184 whose name is to be returned.
185
186 @param ChildHandle[in] The handle of the child controller to retrieve the name
187 of. This is an optional parameter that may be NULL. It
188 will be NULL for device drivers. It will also be NULL
189 for a bus drivers that wish to retrieve the name of the
190 bus controller. It will not be NULL for a bus driver
191 that wishes to retrieve the name of a child controller.
192
193 @param Language[in] A pointer to a three character ISO 639-2 language
194 identifier. This is the language of the controller name
195 that that the caller is requesting, and it must match one
196 of the languages specified in SupportedLanguages. The
197 number of languages supported by a driver is up to the
198 driver writer.
199
200 @param ControllerName[out] A pointer to the Unicode string to return. This Unicode
201 string is the name of the controller specified by
202 ControllerHandle and ChildHandle in the language
203 specified by Language from the point of view of the
204 driver specified by This.
205
206 @retval EFI_SUCCESS The Unicode string for the user readable name in the
207 language specified by Language for the driver
208 specified by This was returned in DriverName.
209
210 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
211
212 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
213
214 @retval EFI_INVALID_PARAMETER Language is NULL.
215
216 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
217
218 @retval EFI_UNSUPPORTED The driver specified by This is not currently managing
219 the controller specified by ControllerHandle and ChildHandle.
220
221 @retval EFI_UNSUPPORTED The driver specified by This does not support the
222 language specified by Language.
223
224 **/
225 EFI_STATUS
226 EFIAPI
227 IScsiComponentNameGetControllerName (
228 IN EFI_COMPONENT_NAME_PROTOCOL *This,
229 IN EFI_HANDLE ControllerHandle,
230 IN EFI_HANDLE ChildHandle OPTIONAL,
231 IN CHAR8 *Language,
232 OUT CHAR16 **ControllerName
233 );
234
235 //
236 // EFI IScsi Initiator Name Protocol for IScsi driver.
237 //
238 /**
239 Retrieves the current set value of iSCSI Initiator Name.
240
241 @param This[in] Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL instance.
242
243 @param BufferSize[in][out] Size of the buffer in bytes pointed to by Buffer / Actual
244 size of the variable data buffer.
245
246 @param Buffer[out] Pointer to the buffer for data to be read.
247
248 @retval EFI_SUCCESS Data was successfully retrieved into the provided
249 buffer and the BufferSize was sufficient to handle the
250 iSCSI initiator name.
251 @retval EFI_BUFFER_TOO_SMALL BufferSize is too small for the result. BufferSize will
252 be updated with the size required to complete the request.
253 Buffer will not be affected.
254
255 @retval EFI_INVALID_PARAMETER BufferSize is NULL. BufferSize and Buffer will not be
256 affected.
257
258 @retval EFI_INVALID_PARAMETER Buffer is NULL. BufferSize and Buffer will not be
259 affected.
260
261 @retval EFI_DEVICE_ERROR The iSCSI initiator name could not be retrieved due to
262 a hardware error.
263
264 **/
265 EFI_STATUS
266 EFIAPI
267 IScsiGetInitiatorName (
268 IN EFI_ISCSI_INITIATOR_NAME_PROTOCOL *This,
269 IN OUT UINTN *BufferSize,
270 OUT VOID *Buffer
271 );
272
273 /**
274 Sets the iSCSI Initiator Name.
275
276 @param This[in] Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL instance.
277
278 @param BufferSize[in][out] Size of the buffer in bytes pointed to by Buffer.
279
280 @param Buffer[out] Pointer to the buffer for data to be written.
281
282 @retval EFI_SUCCESS Data was successfully stored by the protocol.
283
284 @retval EFI_UNSUPPORTED Platform policies do not allow for data to be written.
285
286 @retval EFI_INVALID_PARAMETER BufferSize exceeds the maximum allowed limit.
287 BufferSize will be updated with the maximum size
288 required to complete the request.
289
290 @retval EFI_INVALID_PARAMETER Buffersize is NULL. BufferSize and Buffer will not be
291 affected.
292
293 @retval EFI_INVALID_PARAMETER Buffer is NULL. BufferSize and Buffer will not be affected.
294
295 @retval EFI_DEVICE_ERROR The data could not be stored due to a hardware error.
296
297 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the data.
298
299 @retval EFI_PROTOCOL_ERROR Input iSCSI initiator name does not adhere to RFC 3720.
300
301 **/
302 EFI_STATUS
303 EFIAPI
304 IScsiSetInitiatorName (
305 IN EFI_ISCSI_INITIATOR_NAME_PROTOCOL *This,
306 IN OUT UINTN *BufferSize,
307 OUT VOID *Buffer
308 );
309
310 #endif